#quixoft-setup_future_usage
1 messages ยท Page 1 of 1 (latest)
Hello! Starting up a thread for you
If you don't supply setup_future_usage when creating a Payment Intent then it's just null/empty and that payment isn't correctly set up to collect information needed to use the payment method for future payments
What about the case of not supplying setup_future_usage parameter at but we do supply the parameter off_session=true? Does that setup the possibility of future payments?
These two keep tripping me up with the naming and what exactly they do.
No, those are two separate things - setup_future_usage indicates how you want to use the payment method in the future (on or off-session or leave it empty to say you don't want to use it in the future at all). off_session is used to indicate the state of the current transaction and whether the user is on or off session when they are completing th epayment
Thanks for the clarification.
I'm not convinced that's the case though. I have a customer who signed up for a subscription in Aug, 2022. We supplied off_session=true and did NOT supply setup_future_usage for the initial payment. (looking at the request via the Stripe Dash)
We then successfully reused the same saved payment method in subsequent recurring subscription charges in Sept and Oct. In both of those subsequent payments we did NOT supply setup_future_usage and set off_session=true
So clearly the payment method is still attached to the customer and reusable even though we've never supplied setup_future_usage . So it's either defaulting to setup_future_usage=off_session or we are somehow able to make it work without.
Ah, you didn't mention subscriptions were involved - Subscription payment intents set setup_future_usage: off_session automatically (since the expectation is you'll need to charge the payment method again)
When you say subscriptions, are you referring to Stripes subscription product?
We aren't using Stripe's subscription products, we use our own internal subscription software and trigger the payments through Stripe via calls to PaymenetIntent create.
DOes that change anything?
Yeah I was referring to Stripe's subscriptions - so yes, this does change things
But really, not setting setup_future_usage on a PI doesn't guarantee that future recurring payments will fail - it just makes them more likely to fail because if additional things (like authentication) are needed for that card then payment.
I can also double check if you provide an example Payment Method or Payment Intent ID I can look at
Ok. will DM you the IDs.
You can just share them here - PM/PI ids aren't sensitive
Customer: cus_MCmpEbAklnsrtF
PaymentMethod: card_1LUNGfLpw5ZaWGurl7UvniFB
PaymentIntents:
August: pi_3LUNGlLpw5ZaWGur1p3eiIky
Sept: pi_3LfcDSLpw5ZaWGur0o4zOYUf
Oct: pi_3LqUVuLpw5ZaWGur1QbSaYb4
Yeah as far as I can see these payments just happened to not need any additional action and were able to succeed anyways - this card was never used with setup_future_usage
I'm guessing that shouldn't happen. Please correct me if I'm wrong but this is how I believe it should work:
- Initial payment is on session as the customer is in the flow. Need to supply
setup_future_usage=off_sessionandoff_session=false - Subsequent recurring subscription payments should NOT supply
setup_future_usageat all and supplyoff_session=trueas the customer isn't in the recurring subscription flow.
If we're only managing to have things work because of some unknown flow through Stripe, I'd prefer to refactor our code to do the correct way.
^^ So yes, that's how you should be correctly setting up your payments, but the fact that those other payments succeeded isn't unexpected behavior/wrong - it's more "lucky" that this card just happened to now need additional steps/actions to be charged.
It's not an unknown flows, it's just one that is more likely to fail because it's missing some setup steps
Ok, I think that answers my question. Thank you so much for the help!
๐ glad I could help clear things up!
One suggestion, deprecate the current setup_future_usage values and change them to something other than on_session and off_session.
Every person I've spoken with gets confused about the parameter off_session and the value off_session for the setup_future_usage param. ๐