#jean-baptiste-r_code
1 messages Β· Page 1 of 1 (latest)
π Welcome to your new thread!
β²οΈ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
β±οΈ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
π This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1329729155478196257
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Little note: We are only doing one time payments.
hello! taking a look, gimme a while
https://support.stripe.com/questions/what-is-the-difference-between-on-session-and-off-session-and-why-is-it-important - this explains on-session and off-session in detail. In summary
βOn sessionβ is when the customer pays on your app/website, while βoff sessionβ is when the payment is initiated automatically or by the merchant.
when you use setup_future_usage, you'll typically use off_session so that you can reuse the PaymentMethod either off-session on on-session. If you use setup_future_usage='on_session, the saved payment method cannot be used off_session.
Note : If you don't include setup_future_usage when creating the PaymentIntent, this means the payment method that used to make payment is one-time use, and cannot be reused
You can charge a saved payment method later off-session, which you can read about in more detail here : https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=stripe-hosted#charge-saved-payment-method
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Thank you for your answer π
So, in my use case, because I'm only using one-time payments, I can just remove the setup_future_usage property and everything will be fine π€
Payments are always initiated "on_session", but I guess it's not the case with bank transfers π€
I'm not sure if I'm doing something wrong right now tbh
what's the issue that you're facing? can you share more?
My initial payment was the code I send you on the first message.
Initially, I offered users to pay by card (or Apple Pay/Google Pay for that matter).
For some reasons, I need to let them use SEPA debits and bank transfers.
When I add them in the payment_method_types property, I have an error: Stripe tells me that bank transfers are not allowed with setup_future_usage property.
So I'm thinking about removing the setup_future_usage property to remove this error. (and it works, I have no error when I remove this property)
But here is my problem: I don't know what are consequences when I remove this property. Are there some security issues ? Or else ?
(We only do one-time use payments, so according to your first message, it should be fine for payments, but not sure about security)
π taking over for my colleague. Let me catch up.
take your time
So, here is the error from Stripe, now I'm gonna show you what I changed in our code
In our backend application, I changed this:
const paymentIntent = await stripe.paymentIntents.create({
amount: Math.round(payload.amountInEuros * 100),
currency: payload.currency || 'eur',
customer: payload.customerId,
payment_method: payload.creditCardId,
payment_method_types: ['card'],
setup_future_usage: payload.setupFutureUsage,
confirm: payload.confirm || false,
metadata: {
...payload.documentData,
...(payload.metadata || {}),
},
})
to this:
const paymentIntent = await stripe.paymentIntents.create({
amount: Math.round(payload.amountInEuros * 100),
currency: payload.currency || 'eur',
customer: payload.customerId,
payment_method: payload.creditCardId,
payment_method_types: ['card', 'customer_balance', 'sepa_debit'],
setup_future_usage: payload.setupFutureUsage,
confirm: payload.confirm || false,
metadata: {
...payload.documentData,
...(payload.metadata || {}),
},
})
The only line who changed is the payment_method_types property.
According to your documentation, customer_balance is the enum value for bank transfers and sepa_debit for SEPA debits
I think you have all the needed information... Don't hesitate to ask π
Sorry if my english is weird tho π
passing setup future usage means that you're asking your customer whether they agree that you save their PaymentMethod to be used in the future
Customer Balance can't be used in the future automatically
since the customer needs to wire the money to the provided bank account
Sounds logic π€
there's no security aspect in using sfu or not
Oh okay, so I can simply remove the sfu property and everything is fine ?
yes but this also means that if the customer chooses to pay by card or SEPA Debit, you won't be able to charge them in the future directly
I'm not sure what you mean sorry π
Oh, so it means that I can't save the card (or any other payment method) for future payments ?
if you remove the setup_future_usage param yes
but don't worry
there's a workaround this
I have a last question
sure
This is exactly what I'm looking for, but I'd like to not use the payment_method_types because we are now using the Dashboard.
Will this solution (I mean, the solution with payment_method_options you just sent) be a problem ? Or will everything be fine with this ?
no you can still pass the pmo while still using PaymentMethodConfigurations (pmc)
Alright thank you, I'm going to do some tests then π
Have a good day/evening !