feat(stripe): Support automatic payment methods (#2492)

This commit is contained in:
Sebastian Rindom
2022-10-30 14:32:00 +02:00
committed by GitHub
parent b88cef2b1f
commit a9acb48fc6
2 changed files with 9 additions and 0 deletions

View File

@@ -10,5 +10,10 @@ Learn more about how you can use this plugin in the [documentaion](https://docs.
{
api_key: "STRIPE_API_KEY",
webhook_secret: "STRIPE_WEBHOOK_SECRET",
automatic_payment_methods: true
}
```
## Automatic Payment Methods
If you wish to use [Stripe's automatic payment methods](https://stripe.com/docs/connect/automatic-payment-methods) set the `automatic_payment_methods` flag to true.

View File

@@ -148,6 +148,10 @@ class StripeProviderService extends AbstractPaymentService {
metadata: { cart_id: `${cart.id}` },
}
if (this.options_?.automatic_payment_methods) {
intentRequest.automatic_payment_methods = { enabled: true }
}
if (customer_id) {
const customer = await this.customerService_
.withTransaction(this.manager_)