#parisholley - share payment method
1 messages ยท Page 1 of 1 (latest)
and i'm assuming there would be no way to have the user provide their cc info just once and share across two intents?
If it's 1 customer with 1 card, you can use that across multiple payment intents. As long as the card is attached to that customer object, it's totally re-usable
You'd just pass its id here: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
sorry, i meant setup intent
Nah that's not how setup intents work unfortunately. You would have to initialize Elements with the Setup Intent client secret and then provide card details to set up that card for future usage.
What's your use-case for this?
we were looking to move off our in-house billing setup (using stripe) to billing/subscriptions, but there is a limitation with how it works and we were recommended to create two sep customers to manage each subscription (need two active at a time).
but that isn't intuitive for user if they have to enter payment method twice
yes, we have a unique billing model that stripe billing doesn't support well out the box, and would require us to workaround it a few ways
Well 1 customer can have 2 active subscriptions. That's not an issue. Why does it need to be 2 customer objects?
ultimately the issue is we need to be able to not apply customer credits to an invoice
we have a pre-paid/metered subscription and a saas subcription
we can't tell stripe to not apply pre-paid credits to the saas subscription, hence two customer accounts
Gotcha. Yeah this is a niche use-case. Are you using the Payment Element currently to collect card details?
stripe.js, but intended on moving to payment element
Which element with stripe.js? Card element https://stripe.com/docs/payments/card-element ?
Payment Element is also a part of stripe.js
card.createToken
Gotcha, but what is the form you use to collect card info?
Is it the card element?
Ah I see. I have 1 suggestion that should work with the Card Element, but it won't work well with the Payment Element. You can initialize the Card Element without a Payment Intent/Setup Intent client secret (but not with the Payment Element). What you can do is collect card details with the card element (that previous link I linked) then create 2 payment methods (using stripe.js): https://stripe.com/docs/js/payment_methods/create_payment_method (this assumes you already created your 2 customer objects). Then, attach the first payment method created to customer 1 (on the back-end) and the second payment method created to customer 2 (also on the back-end)
This api call on the back-end: https://stripe.com/docs/api/payment_methods/attach
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.