Skip to content

Commit

Permalink
Merge pull request #11 from dystcz/feature/fix-automatic-payment-methods
Browse files Browse the repository at this point in the history
Fix automatic payment methods
  • Loading branch information
repl6669 authored Mar 16, 2024
2 parents 73fb96d + c7505b1 commit 909cde1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 37 deletions.
71 changes: 35 additions & 36 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions config/stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@
|
*/
'type' => 'stripe',

/**
* Automatic payment methods
*
* Enable automatic payment methods.
*/
'automatic_payment_methods' => true,
];
2 changes: 1 addition & 1 deletion src/Managers/StripeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function buildIntent($value, $currencyCode, $shipping): PaymentIntent

$intentData = array_merge(
$intentData,
Config::get('lunar-api.stripe.automatic_payment_methods', false)
Config::get('lunar-api.stripe.automatic_payment_methods', true)
? ['automatic_payment_methods' => ['enabled' => true]]
: ['payment_method_types' => Config::get('lunar-api.stripe.payment_method_types', ['card'])]
);
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public function getEnvironmentSetUp($app): void
'payment_intent' => env('STRIPE_WEBHOOK_SECRET'),
],
]);
Config::set('lunar-api.stripe.automatic_payment_methods', false);

// Default payment driver
Config::set('lunar.payments.default', 'stripe');
Expand Down

0 comments on commit 909cde1

Please sign in to comment.