mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-27 16:34:00 +00:00
debug billplz payment
This commit is contained in:
@@ -19,4 +19,15 @@ final class ApprovalStatus {
|
||||
public const EXPIRED = 6;
|
||||
|
||||
public const REFUNDED = 7;
|
||||
|
||||
public const APPROVAL_STATUS_ID = [
|
||||
self::PENDING_SUBMISSION => "Pending Submission",
|
||||
self::PENDING_VERIFICATION => "Pending Verification",
|
||||
self::APPROVED => "Approved",
|
||||
self::COMPLETED => "Completed",
|
||||
self::REJECTED => "Rejected",
|
||||
self::SUSPENDED => "Suspended",
|
||||
self::EXPIRED => "Expired",
|
||||
self::REFUNDED => "Refunded",
|
||||
];
|
||||
}
|
||||
|
||||
@@ -55,18 +55,23 @@ class debugBillplzFailedPayment extends Command
|
||||
$data = $response->json();
|
||||
if($data['paid']){
|
||||
if (!in_array($transaction->status, [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])) {
|
||||
$this->info('Paid transaction - id: '. $transaction->id . '. Booking Marking: '. $transaction->owner->marking . ' - Date: '.$transaction->created_at->format('d-m-Y').' - Amount: '. $transaction->amount);
|
||||
$this->returnLog('Paid transaction', $transaction);
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// $totalAmount += $transaction->amount;
|
||||
// $this->info('Unpaid Transaction - id:' . $transaction->id . ' - Date: '.$transaction->owner->created_at->format('d-m-Y').' - Amount: '. $transaction->amount);
|
||||
// $this->returnLog('Unpaid Transaction', $transaction);
|
||||
// }
|
||||
}else{
|
||||
$this->info('billplz error - id: '. $transaction->id . ' - Date: '.$transaction->created_at->format('d-m-Y'));
|
||||
$this->returnLog('billplz error', $transaction);
|
||||
}
|
||||
}
|
||||
|
||||
echo 'Total: ' . $totalAmount;
|
||||
}
|
||||
|
||||
public function returnLog($text, $transaction) {
|
||||
$approvalStatusArray = ApprovalStatus::APPROVAL_STATUS_ID;
|
||||
$this->info($text . ' - id: '. $transaction->id . '. Booking Marking: '. $transaction->owner->marking . ' - Date: '.$transaction->created_at->format('d-m-Y').' - Amount: '. $transaction->amount . '. Current Status: ' . $approvalStatusArray[$transaction->status]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user