From 213e46e9899b0303fff38b25a41b2888d4717ad9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 8 May 2022 11:22:59 +1000 Subject: [PATCH] Fixes for SEPA auto-billing --- app/PaymentDrivers/Stripe/Charge.php | 3 + ...4937_heal_stripe_gateway_configuration.php | 58 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 database/migrations/2022_05_08_004937_heal_stripe_gateway_configuration.php diff --git a/app/PaymentDrivers/Stripe/Charge.php b/app/PaymentDrivers/Stripe/Charge.php index f083a6d5784f..47508ca1fe4a 100644 --- a/app/PaymentDrivers/Stripe/Charge.php +++ b/app/PaymentDrivers/Stripe/Charge.php @@ -84,6 +84,9 @@ class Charge ], ]; + if($cgt->gateway_type_id == GatewayType::SEPA) + $data['payment_method_types'] = ['sepa_debit']; + $response = $this->stripe->createPaymentIntent($data, $this->stripe->stripe_connect_auth); SystemLogger::dispatch($response, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_SUCCESS, SystemLog::TYPE_STRIPE, $this->stripe->client, $this->stripe->client->company); diff --git a/database/migrations/2022_05_08_004937_heal_stripe_gateway_configuration.php b/database/migrations/2022_05_08_004937_heal_stripe_gateway_configuration.php new file mode 100644 index 000000000000..c68db858b46d --- /dev/null +++ b/database/migrations/2022_05_08_004937_heal_stripe_gateway_configuration.php @@ -0,0 +1,58 @@ + 'Stripe', + 'provider' => 'Stripe', + 'sort_order' => 1, + 'key' => 'd14dd26a37cecc30fdd65700bfb55b23', + 'fields' => '{"publishableKey":"","apiKey":"","appleDomainVerification":""}' + ]; + + $record = Gateway::find(20); + + if ($record) { + $record->fill($stripe); + $record->save(); + } + + $this->buildCache(true); + + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}