wip
This commit is contained in:
@@ -2,17 +2,31 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class ApiTesterController extends Controller
|
class ApiTesterController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
|
$data = $request->validate([
|
||||||
|
'passport_serie' => 'I-AH',
|
||||||
|
'passport_number' => '152304',
|
||||||
|
'card_number_masked' => '993403******8088',
|
||||||
|
'card_expire_date' => '02/34',
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
|
||||||
|
// return "<pre>{$response}</pre>";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function fetchApi(
|
||||||
|
string $passport_serie,
|
||||||
|
string $passport_number,
|
||||||
|
string $card_number_masked,
|
||||||
|
string $card_expire_date
|
||||||
|
) {
|
||||||
$curl = curl_init();
|
$curl = curl_init();
|
||||||
|
|
||||||
$passport_serie = 'I-AH';
|
|
||||||
$passport_number = '152304';
|
|
||||||
$card_number_masked = '993403******8088';
|
|
||||||
$card_expire_date = '02/34';
|
|
||||||
|
|
||||||
curl_setopt_array($curl, [
|
curl_setopt_array($curl, [
|
||||||
CURLOPT_URL => 'http://10.3.158.102:9999/api/clientinfo/all',
|
CURLOPT_URL => 'http://10.3.158.102:9999/api/clientinfo/all',
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
@@ -33,6 +47,6 @@ class ApiTesterController extends Controller
|
|||||||
|
|
||||||
curl_close($curl);
|
curl_close($curl);
|
||||||
|
|
||||||
return "<pre>{$response}</pre>";
|
return $response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,16 @@ namespace App\Models\Order\Card\CardTransaction;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Laravel\Nova\Actions\Actionable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property string $passport_serie
|
||||||
|
* @property string $passport_number
|
||||||
|
* @property string $card_number_masked
|
||||||
|
* @property string $card_expire_date
|
||||||
|
*/
|
||||||
class CardTransaction extends Model
|
class CardTransaction extends Model
|
||||||
{
|
{
|
||||||
|
use Actionable;
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('card_transactions', function (Blueprint $table) {
|
Schema::create('card_transactions', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
$table->string('passport_serie');
|
||||||
|
$table->string('passport_number');
|
||||||
|
$table->string('card_number_masked');
|
||||||
|
$table->string('card_expire_date');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user