mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
debug payment not showing issue
This commit is contained in:
+28
-2
@@ -922,8 +922,10 @@ Route::get('/transfer/{marking}/payment-details', function ($marking) {
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
|
||||
echo '<br>';
|
||||
echo '<td><a href="'.route('wallet.details', $booking->company->reference).'" target="_blank">Wallet Details</a></td>';
|
||||
echo '<br> ----------------------------------------------------------------<br>';
|
||||
|
||||
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 '<table border="1" width="100%">';
|
||||
echo '<thead>';
|
||||
@@ -965,6 +970,8 @@ Route::get('show-booking-expired', function () {
|
||||
echo '<th>Amount</th>';
|
||||
echo '<th>Type</th>';
|
||||
echo '<th>Status</th>';
|
||||
echo '<th>Payment Method</th>';
|
||||
echo '<th>BillPlz Response</th>';
|
||||
echo '<th>Updated At</th>';
|
||||
echo '</tr>';
|
||||
echo '</thead>';
|
||||
@@ -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 '<tr>';
|
||||
echo '<td>' . $counter++ . '</td>';
|
||||
echo '<td>' . $transaction->id . '</td>';
|
||||
@@ -981,6 +1005,8 @@ Route::get('show-booking-expired', function () {
|
||||
echo '<td>' . $transaction->amount . '</td>';
|
||||
echo '<td>' . $statusLabels[$transaction->type] . '</td>';
|
||||
echo '<td>' . $ApprovalStatus [$transaction->status] . '</td>';
|
||||
echo '<td>' . $paymentMethods [$transaction->payment_method] . '</td>';
|
||||
echo '<td>' . $billplz_status . '</td>';
|
||||
echo '<td>' . $transaction->updated_at . '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user