Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe Payment plugin support "Accept International Payments from India" #2412

Closed
duypv opened this issue Sep 26, 2023 · 3 comments
Closed

Comments

@duypv
Copy link

duypv commented Sep 26, 2023

Is your feature request related to a problem? Please describe.
Stripe for India require: name, billing address, shipping address or description in paymentIntent

Describe the solution you'd like
Can be define it in init plugin. Example
image

Describe alternatives you've considered
I had fork payment plugin and hard in code.
image

const newStripeCustomer = await stripe.customers.create({
                email: customer.emailAddress,
                name: ${customer.firstName} ${customer.lastName},
                address: {
                    line1: customer.addresses[0]?.streetLine1 || order.shippingAddress?.streetLine1,
                    postal_code: customer.addresses[0]?.postalCode || order.shippingAddress?.postalCode,
                    city: customer.addresses[0]?.city || order.shippingAddress?.city,
                    state: customer.addresses[0]?.province || order.shippingAddress?.province,
                    country: customer.addresses[0]?.country.code || order.shippingAddress?.countryCode,
                },
            });

Additional context
Document here: https://stripe.com/docs/india-accept-international-payments
"@vendure/core": "^2.0.6"

@michaelbromley
Copy link
Member

Thanks for the info on this.

So if I understand correctly, we need to be able to:

  1. Customize the API call to Stripe which creates the customer to include additional fields
  2. Customize the API call to Stripe which creates the payment intent to include additional fields.

I propose that we expose this functionality in a similar way to how metadata is handled: you can provide a custom function which returns the extra fields to be added. This can be an async function so you can look up any other data you need.

@duypv
Copy link
Author

duypv commented Sep 26, 2023

yes, that right.

@michaelbromley
Copy link
Member

This will be in the next pre-release for v2.1 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants