in-person payments and payment_method_types with stripe #4575
-
I'm hoping to accept both in-person and e-commerce purchases with medusajs / stripe. For this to work, I need a payment intent with # python example
stripe.PaymentIntent.create(
currency="usd",
payment_method_types=["card", "card_present"],
capture_method="automatic",
amount=1000,
) Looking through the source code, it seems if I set the environment variable getPaymentIntentOptions(): PaymentIntentOptions {
const options: PaymentIntentOptions = {}
if (this?.paymentIntentOptions?.capture_method) {
options.capture_method = this.paymentIntentOptions.capture_method
}
if (this?.paymentIntentOptions?.setup_future_usage) {
options.setup_future_usage = this.paymentIntentOptions.setup_future_usage
}
if (this?.paymentIntentOptions?.payment_method_types) {
options.payment_method_types =
this.paymentIntentOptions.payment_method_types
}
return options
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I know that @josipmatichr has experience with accepting Stripe Terminal payments. Maybe he can share some learnings? |
Beta Was this translation helpful? Give feedback.
-
@srindom of course! @tyler71 I think you won't be able to set
Just remember to enable "stripe-terminal" in the region payment provider settings :) Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Thank you! This is very helpful |
Beta Was this translation helpful? Give feedback.
@srindom of course! @tyler71 I think you won't be able to set
payment_method_types
through environment variables sincepaymentIntentOptions
should be defined through child class. I would suggest creating a new service that will extend base stripe service, something like this should work: