From fc8d56ad0edf7971e63186e7dd036c96a307bd71 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 10 Oct 2021 09:37:42 +1100 Subject: [PATCH] Minor fixes for GiroPay --- app/Console/Commands/CreateSingleAccount.php | 14 +++++++------- app/Models/Gateway.php | 2 +- app/PaymentDrivers/StripePaymentDriver.php | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Console/Commands/CreateSingleAccount.php b/app/Console/Commands/CreateSingleAccount.php index 364209f343..92d1bacf36 100644 --- a/app/Console/Commands/CreateSingleAccount.php +++ b/app/Console/Commands/CreateSingleAccount.php @@ -630,7 +630,7 @@ class CreateSingleAccount extends Command $cg->config = encrypt(config('ninja.testvars.stripe')); $cg->save(); - $gateway_types = $cg->driver(new Client)->gatewayTypes(); + $gateway_types = $cg->driver()->gatewayTypes(); $fees_and_limits = new stdClass; $fees_and_limits->{$gateway_types[0]} = new FeesAndLimits; @@ -653,7 +653,7 @@ class CreateSingleAccount extends Command $cg->config = encrypt(config('ninja.testvars.paypal')); $cg->save(); - $gateway_types = $cg->driver(new Client)->gatewayTypes(); + $gateway_types = $cg->driver()->gatewayTypes(); $fees_and_limits = new stdClass; $fees_and_limits->{$gateway_types[0]} = new FeesAndLimits; @@ -716,7 +716,7 @@ class CreateSingleAccount extends Command $cg->config = encrypt(config('ninja.testvars.wepay')); $cg->save(); - $gateway_types = $cg->driver(new Client)->gatewayTypes(); + $gateway_types = $cg->driver()->gatewayTypes(); $fees_and_limits = new stdClass; $fees_and_limits->{$gateway_types[0]} = new FeesAndLimits; @@ -737,7 +737,7 @@ class CreateSingleAccount extends Command $cg->config = encrypt(config('ninja.testvars.braintree')); $cg->save(); - $gateway_types = $cg->driver(new Client)->gatewayTypes(); + $gateway_types = $cg->driver()->gatewayTypes(); $fees_and_limits = new stdClass; $fees_and_limits->{$gateway_types[0]} = new FeesAndLimits; @@ -761,7 +761,7 @@ class CreateSingleAccount extends Command $cg->save(); - $gateway_types = $cg->driver(new Client)->gatewayTypes(); + $gateway_types = $cg->driver()->gatewayTypes(); $fees_and_limits = new stdClass; $fees_and_limits->{$gateway_types[0]} = new FeesAndLimits; @@ -782,7 +782,7 @@ class CreateSingleAccount extends Command $cg->config = encrypt(config('ninja.testvars.mollie')); $cg->save(); - $gateway_types = $cg->driver(new Client)->gatewayTypes(); + $gateway_types = $cg->driver()->gatewayTypes(); $fees_and_limits = new stdClass; $fees_and_limits->{$gateway_types[0]} = new FeesAndLimits; @@ -803,7 +803,7 @@ class CreateSingleAccount extends Command $cg->config = encrypt(config('ninja.testvars.square')); $cg->save(); - $gateway_types = $cg->driver(new Client)->gatewayTypes(); + $gateway_types = $cg->driver()->gatewayTypes(); $fees_and_limits = new stdClass; $fees_and_limits->{$gateway_types[0]} = new FeesAndLimits; diff --git a/app/Models/Gateway.php b/app/Models/Gateway.php index c4260669a9..abb0d2c50a 100644 --- a/app/Models/Gateway.php +++ b/app/Models/Gateway.php @@ -105,7 +105,7 @@ class Gateway extends StaticModel GatewayType::APPLE_PAY => ['refund' => false, 'token_billing' => false], GatewayType::SOFORT => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded']], //Stripe GatewayType::SEPA => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded']], - GatewayType::GIROPAY => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded']]]; + GatewayType::GIROPAY => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded']], GatewayType::IDEAL => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded']]]; case 39: diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index 8d7a8a112e..cac69474a1 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -161,6 +161,8 @@ class StripePaymentDriver extends BaseDriver } if ($this->client + && $this->client->currency() + && ($this->client->currency()->code == 'EUR') && isset($this->client->country) && in_array($this->client->country->iso_3166_3, ["DEU"])) $types[] = GatewayType::GIROPAY;