wip
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class FetchCardHistoryController extends Controller
|
||||
{
|
||||
@@ -16,14 +15,34 @@ class FetchCardHistoryController extends Controller
|
||||
'card_expiry_date' => ['required', 'string', 'max:255'],
|
||||
]);
|
||||
|
||||
$response = Http::withBody('{
|
||||
$curl = curl_init();
|
||||
|
||||
curl_setopt_array($curl, [
|
||||
CURLOPT_URL => 'http://10.3.158.102:9999/api/clientinfo',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => '{
|
||||
"idSeria": "I-AS",
|
||||
"idNo": "314567",
|
||||
"clientType": "recipient",
|
||||
"cardMaskNumber": "993403******3258",
|
||||
"expDate": "07/49"
|
||||
"clientType":"recipient",
|
||||
}')->acceptJson()->post('http://10.3.158.102:9999/api/clientinfo');
|
||||
}',
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Accept: application/json',
|
||||
'Content-Type: application/json',
|
||||
],
|
||||
]);
|
||||
|
||||
return $response->body();
|
||||
$response = curl_exec($curl);
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Laravel\Nova\Fields\Date;
|
||||
use Laravel\Nova\Fields\Email;
|
||||
use Laravel\Nova\Fields\Heading;
|
||||
use Laravel\Nova\Fields\Hidden;
|
||||
use Laravel\Nova\Fields\ID;
|
||||
use Laravel\Nova\Fields\Image;
|
||||
|
||||
@@ -93,7 +93,7 @@ class LoanOrderMobileFieldsForDetail
|
||||
new Panel(__('Card'), [
|
||||
NovaCustomHtml::make(__('Data'), 'card_name')
|
||||
->html(view('orders.loan.mobile.card-history', [
|
||||
'resource' => $resource
|
||||
'resource' => $resource,
|
||||
])->render())
|
||||
->fillUsing(NovaForm::fillEmpty()),
|
||||
]),
|
||||
|
||||
@@ -46,7 +46,8 @@ class NovaCustomHtml extends Field
|
||||
|
||||
/**
|
||||
* Hide
|
||||
* @param bool|boolean
|
||||
*
|
||||
* @param bool|bool
|
||||
*/
|
||||
public function hidden(bool $hidden = true): self
|
||||
{
|
||||
|
||||
41
resources/js/vendor/nova/js/additional.js
vendored
41
resources/js/vendor/nova/js/additional.js
vendored
@@ -27,33 +27,34 @@ async function fetchCardHistory(passport_serie, passport_id, card_number, card_e
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
console.log({result: result})
|
||||
if (result.errCode != 0) {
|
||||
Nova.error('Barlap bolmady, tor näsazlygy')
|
||||
}
|
||||
|
||||
cardHistoryDetailContainer.innerHTML = `
|
||||
<h4 class="mb-4">Şahamça: <strong>${result.depName}, </strong></h4>
|
||||
// cardHistoryDetailContainer.innerHTML = `
|
||||
// <h4 class="mb-4">Şahamça: <strong>${result.depName}, </strong></h4>
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
${Array.from(result.transactions).map(transaction => {
|
||||
return `<li style="background: #a3c1f5;color: black;" class="p-3 relative rounded-lg">
|
||||
<strong>${transaction['actionName']}</strong> <strong>${transaction['opersum']}</strong> <strong>${transaction['currency']}</strong>
|
||||
// <p>
|
||||
// <ul>
|
||||
// ${Array.from(result.transactions).map(transaction => {
|
||||
// return `<li style="background: #a3c1f5;color: black;" class="p-3 relative rounded-lg">
|
||||
// <strong>${transaction['actionName']}</strong> <strong>${transaction['opersum']}</strong> <strong>${transaction['currency']}</strong>
|
||||
|
||||
<strong style="top: 0; right: 0;" class="absolute p-2">${transaction['opername']}</strong>
|
||||
// <strong style="top: 0; right: 0;" class="absolute p-2">${transaction['opername']}</strong>
|
||||
|
||||
<p><strong>${
|
||||
new Date(transaction['trandate']).toLocaleDateString('en-GB', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
}).replaceAll('/', '.')
|
||||
}</strong></p>
|
||||
</li>`;
|
||||
})}
|
||||
</ul>
|
||||
</p>
|
||||
`;
|
||||
// <p><strong>${
|
||||
// new Date(transaction['trandate']).toLocaleDateString('en-GB', {
|
||||
// year: 'numeric',
|
||||
// month: '2-digit',
|
||||
// day: '2-digit',
|
||||
// }).replaceAll('/', '.')
|
||||
// }</strong></p>
|
||||
// </li>`;
|
||||
// })}
|
||||
// </ul>
|
||||
// </p>
|
||||
// `;
|
||||
})
|
||||
.catch(error => console.log('error', error));
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
use App\Http\Controllers\Auth\LoginController;
|
||||
use App\Http\Controllers\Auth\RegisterController;
|
||||
use App\Http\Controllers\Auth\ResetPasswordController;
|
||||
use App\Http\Controllers\FetchCardHistoryController;
|
||||
use App\Http\Controllers\LocaleController;
|
||||
use App\Http\Controllers\OnlinePaymentController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@@ -39,7 +38,7 @@ Route::middleware(['auth', 'unVerified'])->group(function () {
|
||||
|
||||
Route::get('online-payment-store', [OnlinePaymentController::class, 'store'])->name('online-payment-store');
|
||||
Route::get('online-payment-store-visa-master', [
|
||||
OnlinePaymentController::class, 'visaMaster'
|
||||
OnlinePaymentController::class, 'visaMaster',
|
||||
])->name('online-payment-store-visa-master');
|
||||
|
||||
Route::redirect('/', config('nova.path'));
|
||||
|
||||
Reference in New Issue
Block a user