fix wallet audit

This commit is contained in:
edmondlang
2023-10-24 00:49:07 +08:00
parent 4bdeae997d
commit a701242646
@@ -28,8 +28,13 @@ class WalletTransactionResource extends JsonResource
$description = 'Credit Voucher for '.$this->payment_reference;
break;
case TransactionType::PAYMENT:
$order = Transaction::where('payment_reference', $this->bill_no)->first()->owner->owner->owner;
$invoice = Transaction::where('payment_reference', $this->bill_no)->first();
if(!$invoice) {
$description = 'Payment for unknown invoice, please contact tech support.';
break;
}
$order = $invoice->owner->owner->owner;
if(!$order) {
$description = 'Payment for unknown order, please contact tech support.';
break;