diff --git a/app/Console/Commands/BillplzFailedCallbackPayment.php b/app/Console/Commands/BillplzFailedCallbackPayment.php index 7026efc4..e2b69858 100644 --- a/app/Console/Commands/BillplzFailedCallbackPayment.php +++ b/app/Console/Commands/BillplzFailedCallbackPayment.php @@ -54,7 +54,9 @@ class BillplzFailedCallbackPayment extends Command $this->outputArray = []; $start = new Carbon(); - $transactions = Transaction::where('type', TransactionType::PAYMENT)->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->whereIn('status', [ApprovalStatus::REJECTED])->get(); + $approvalStatusArray = ApprovalStatus::APPROVAL_STATUS_ID; + + $transactions = Transaction::where('type', TransactionType::PAYMENT)->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->whereIn('status', [ApprovalStatus::REJECTED, ApprovalStatus::PENDING_VERIFICATION])->get(); $totalTransactions = count($transactions); $counter = 1; $totalAmount = 0; @@ -65,7 +67,7 @@ class BillplzFailedCallbackPayment extends Command $data = $response->json(); if($data['paid']){ $totalAmount += $transaction->amount; - $this->appendToOutput($counter . ' of ' . $totalTransactions . '. Order: '. $transaction->owner->owner->owner->reference . ' - Date: '.$transaction->owner->created_at->format('d-m-Y').' - Amount: '. $transaction->amount); + $this->appendToOutput($counter . ' of ' . $totalTransactions . '. Order: '. $transaction->owner->owner->owner->reference . ' - Date: '.$transaction->owner->created_at->format('d-m-Y').' - Amount: '. $transaction->amount . '. Status: ' . $approvalStatusArray[$transaction->status]); } else { // $totalAmount += $transaction->amount; // $this->appendToOutput($counter . ' of ' . $totalTransactions . '. Order: '. $transaction->owner->owner->owner->reference . ' - Date: '.$transaction->owner->created_at->format('d-m-Y').' - Amount: '. $transaction->amount);