mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-28 00:43:58 +00:00
Recipient Bank Details to follow payment overriding the default attached to Booking
This commit is contained in:
@@ -18,8 +18,16 @@ class PaymentTransactionResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
|
||||
$booking = in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND])? $this->owner->owner : $this->owner;
|
||||
$booking = null; //cief todo: 66
|
||||
$bank = null;
|
||||
if(in_array((int)$this->type, [TransactionType::BILL, TransactionType::REFUND])){
|
||||
$booking = $this->owner->owner;
|
||||
$bank = $this->owner->bank ?? $booking->bank;
|
||||
}
|
||||
else{
|
||||
$booking = $this->owner;
|
||||
$bank = $this->bank ?? $booking->bank;
|
||||
}
|
||||
|
||||
$booking_marking = '';
|
||||
switch ($this->owner_type) {
|
||||
@@ -38,7 +46,7 @@ class PaymentTransactionResource extends JsonResource
|
||||
'bill_no' => $this->bill_no,
|
||||
'payment_reference' => $this->payment_reference,
|
||||
'payment_method' => (float) $this->payment_method,
|
||||
'recipient_bank_account' => new BankResource($booking->bank),
|
||||
'recipient_bank_account' => new BankResource($bank),
|
||||
'issuer_name' => $this->issuerCompany->name,
|
||||
'issuer_id' => $this->issuerCompany->id,
|
||||
'amount' => (double) $this->amount,
|
||||
|
||||
Reference in New Issue
Block a user