#donjaland-methods
1 messages · Page 1 of 1 (latest)
it would depend, some payment methods might not be compatible with the type of payment you're doing. For example Giropay can't be saved so if your PaymentIntent uses setup_future_usage it won't appear. CB is just a credit card, it's not shown explicitly separately from the normal card form. Apple Pay only appears if you're in Safari on a device that has an active Apple Pay card in the Wallet app.
aha - so setup_future_usage actually filters it...
is there any way to not filter it?
like I want to accept payments, and if I can save it for recurring payments: great. If not, we have logic in place that will alert the customer to submit payment lmanually already
basically what we do is:
1/ user can pay
2/ we try to setup for future usage when possible
3/ next renewals and/or invoices will be attempted to be auto-charged, with a fallback to sending a payment submission invite to the customer if we have no payment method on file for automatically processing it.
so I don't really want to need to make the decision upfront... Just setup for future usage when possible. (also will give you the ability to display it in te new payment elements...)
you can do this, I think, by using https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options
for each payment method you can specify if it will save or not, by passing {card:{setup_future_usage:off_session}, giropay:{}} etc, and not passing setup_future_usage at the top level. Disclaimer, I haven't tried this myself yet, it's a little new and I missed that it existed until someone showed me yesterday
const paymentIntent = await stripe.paymentIntents.create({
amount: calculateOrderAmount(items),
currency: "eur", customer:customer.id,
payment_method_options:{card:{setup_future_usage:"off_session"}},
automatic_payment_methods: {enabled: true}
});
seems like it works, since iDEAL is not something that can be saved, but I can still pay with it here since I'm only specifying to save cards and nothing else. I think that works for your use case.
alright - will have a go at it
if it helps, the table at https://stripe.com/docs/payments/payment-methods/integration-options#additional-api-supportability shows what methods are compatible with which parameters
I'm still not seeing giropay
can you share the PaymentIntent ID pi_xxx?
@lost yoke just wanted to check in since I was going to step away from Discord soon, one of my colleagues can take over but if you have the ID I can try to help with this one since I have the context