diff --git a/routes/web.php b/routes/web.php index 44380046..ddc5ae7e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -922,8 +922,10 @@ Route::get('/transfer/{marking}/payment-details', function ($marking) { echo ''; echo ''; - echo '
'; - echo 'Wallet Details'; + echo '
----------------------------------------------------------------
'; + + echo 'Wallet Details'; + })->name('booking.details.transactions'); @@ -931,6 +933,7 @@ Route::get('show-booking-expired', function () { $transactions = Transaction::where('type', TransactionType::PAYMENT) ->where('status', ApprovalStatus::EXPIRED) ->whereDate('updated_at', '>=', '2024-02-16') + ->take(10) ->orderBy('updated_at', 'desc') ->get(); // print_r(count($transactions)); @@ -954,6 +957,8 @@ Route::get('show-booking-expired', function () { ]; $ApprovalStatus = ApprovalStatus::APPROVAL_STATUS_ID; + + $paymentMethods = PaymentMethodType::PAYMENT_METHODS_ID; echo ''; echo ''; @@ -965,6 +970,8 @@ Route::get('show-booking-expired', function () { echo ''; echo ''; echo ''; + echo ''; + echo ''; echo ''; echo ''; echo ''; @@ -973,6 +980,23 @@ Route::get('show-booking-expired', function () { $counter = 1; foreach ($transactions as $transaction) { + + $billplz_status = null; + + if ($transaction->payment_method == PaymentMethodType::PAYMENT_GATEWAY) { + $response = Http::withBasicAuth(config('billplz.api_key') . ':', '')->get(config('billplz.base_url') . '/api/v3/bills/' . $transaction->payment_reference); + if ($response->successful()) { + $data = $response->json(); + if ($data['paid']) { + $billplz_status = 'Paid'; + } else { + $billplz_status = $transaction->id . " => Fraud"; + } + } else { + $billplz_status = $transaction->id . " => billplz error"; + } + } + echo ''; echo ''; echo ''; @@ -981,6 +1005,8 @@ Route::get('show-booking-expired', function () { echo ''; echo ''; echo ''; + echo ''; + echo ''; echo ''; echo ''; }
AmountTypeStatusPayment MethodBillPlz ResponseUpdated At
' . $counter++ . '' . $transaction->id . '' . $transaction->amount . '' . $statusLabels[$transaction->type] . '' . $ApprovalStatus [$transaction->status] . '' . $paymentMethods [$transaction->payment_method] . '' . $billplz_status . '' . $transaction->updated_at . '