From b4b69ba2234d7758c262f71ae0449f17f57b4782 Mon Sep 17 00:00:00 2001 From: jouls Date: Tue, 30 Apr 2024 09:26:24 +0800 Subject: [PATCH] added dynamic bank information on upcoming payouts based on the default bank payout set by the user --- vendor-payouts.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vendor-payouts.php b/vendor-payouts.php index ebed651..6cf41e5 100644 --- a/vendor-payouts.php +++ b/vendor-payouts.php @@ -211,7 +211,13 @@ $vendorPayoutData = json_decode($response, true); $vendorResponse = getVendorbyId($vendorId); $vendorInformation = json_decode($vendorResponse, true); $bankAccountNumber = $vendorInformation['bank_acount_details'][0]['bank_account_number']; - $bankName = $vendorInformation['bank_acount_details'][0]['bank_name']; + $bankDetails = $vendorInformation['bank_acount_details']; + foreach ($bankDetails as $details) { + if ($details['bank_payout'] === true) { + $bankName = $details['bank_name']; + $bankAccountNumber = $details['bank_account_number']; + } + } $bankNumEnding = substr($bankAccountNumber, -3); ?> Receipient: Account ending in