From 26d48f6e98dfcb5ec64dee3734b92cc183e5dcf5 Mon Sep 17 00:00:00 2001 From: Lars Kusch Date: Thu, 20 Jan 2022 08:29:30 +0100 Subject: [PATCH] Alter Stripe Payment Driver --- app/PaymentDrivers/StripePaymentDriver.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index 8e5b960b268c..a1a055821d48 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -41,6 +41,7 @@ use App\PaymentDrivers\Stripe\Bancontact; use App\PaymentDrivers\Stripe\BECS; use App\PaymentDrivers\Stripe\ACSS; use App\PaymentDrivers\Stripe\BrowserPay; +use App\PaymentDrivers\Stripe\FPX; use App\PaymentDrivers\Stripe\UpdatePaymentMethods; use App\PaymentDrivers\Stripe\Utilities; use App\Utils\Traits\MakesHash; @@ -198,6 +199,13 @@ class StripePaymentDriver extends BaseDriver && in_array($this->client->country->iso_3166_3, ["AUT"])) $types[] = GatewayType::EPS; + if ($this->client + && $this->client->currency() + && ($this->client->currency()->code == 'MYR') + && isset($this->client->country) + && in_array($this->client->country->iso_3166_3, ["MYS"])) + $types[] = GatewayType::FPX; + if ($this->client && $this->client->currency() && ($this->client->currency()->code == 'EUR') @@ -266,6 +274,8 @@ class StripePaymentDriver extends BaseDriver return 'gateways.stripe.becs'; case GatewayType::ACSS: return 'gateways.stripe.acss'; + case GatewayType::FPX: + return 'gateways.stripe.fpx'; default: break; } @@ -540,7 +550,7 @@ class StripePaymentDriver extends BaseDriver $payment = Payment::query() ->where('company_id', $request->getCompany()->id) ->where('transaction_reference', $transaction['id']) - ->first(); + ->first(); } if ($payment) {