#florian-ruen_api
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/1278289170879746072
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- florian-ruen_billing-webhook-events, 1 day ago, 42 messages
- florian-ruen_api, 1 day ago, 14 messages
- florian-ruen_api, 6 days ago, 7 messages
๐ happy to help!
is it possible to change this workflow ? (maybe no ask always, to ask to reuse another payment method ?)
You mean you want in the Checkout Session preview the saved cards or not ?
Maybe something like this yes. But i'm only using setup mode, and don't know if it's possible in that case
Because i'm creating the subscription manually (for many reasons, I can't use subscription mode in checkout session)
The main reason is that, the price that will be displayed on, the checkout session page will not reflect the real price (usage based subscription, with complex pricing model rules)
Maybe something like this yes. But i'm only using setup mode, and don't know if it's possible in that case
Do you have a concrete Checkout Session Id ? what is the part you want to change in it exactly ? can you create a test one and share it with me ?
this one: cs_test_c1CkBW8Nae1cKFuou8nMeatorQ34QtgO5rJAyrgAuPPcxsCjlFPVPgnr0d
It ask for credit card, but if I fill with a credit card already attached to that customer, the customer will have two credit card with same details
And if the customer cancel/subscribe multiple times, it can have 10, 20 or more credit card with same details, which is I want to avoid
You can't avoid this using Checkout Setup. What you can do is, once the customer save a new card, you check the fingerprint of all the cards attached to that customer already and if they have one matches, use it and drop the new one saved, otherwise use the new saved one as a new PM
So you suggest to add a webhook event to detect the event when a new credit card is attached (will be fired before checkout.session.completed), check the fingerprint, if already regisered, drop it, if not use it a the default card, right ?
yes that's an option.
Seems good, but what happend if the customer add manualy using client portal ? there is a check if the card is already added this time ?
I mean, if the customer go to client portal, add manually a card already attached to it, if there is a check before saving this or not (because I don't really want to handle this using webhook)
And got a small question: when a fingerprint is considered different ? at least one credit detail different ? (for example what happend if this is same numbers but different holder name) ?
No, there's no built-in checks. You will have to use webhooks to check it on your end and remove it if needed.
It's not clear, from this doc: https://docs.stripe.com/api/payment_methods/object#payment_method_object-card-fingerprint
I think the easiest way to find out is to try it on your own with test cards: https://docs.stripe.com/testing#cards
Yes this is what my question is here ๐
Will try now
Because using webhook, to handle a lot of cases, can be very complicated (especially if fingerprint always change for a typo in the name, and so one ...)
and got another "question", little bit related to this: is it possible using Stripe to "test" the credit card automatically ?
it mean, charge 1โฌ or something, to test the credit card are valid, and refund it automatically
because as I understood, there is no checks at this time (checkout session), and the payment can fail later right ?
As my colleague suggested, you have to use SetupIntents to save the card for later use. This also performs card authorization to make sure it is valid: https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=stripe-hosted
Will try, thanks!
FYI (if you want to update the docs or something):
- HyXozgmb7RfV8QU7 4242 4242 4242 4242 with 11/25 and 700 and Test1 Test
- HyXozgmb7RfV8QU7 4242 4242 4242 4242 with 11/25 and 700 and Test1 Test
- HyXozgmb7RfV8QU7 4242 4242 4242 4242 with 11/25 and 700 and Test2 Test
- HyXozgmb7RfV8QU7 4242 4242 4242 4242 with 11/26 and 700 and Test1 Test
- HyXozgmb7RfV8QU7 4242 4242 4242 4242 with 11/26 and 701 and Test1 Test
- qdAsdEGuRJyks4Ab 4000 0566 5566 5556 with 11/25 and 700 and Test1 Test
So:
- name no impact on fingerprint
- expiration date no impact on fingerprint
- CCV not impact on fingerprint
- only credit card number have an impact on fingerprint
That's a great finding, thanks for sharing!
Happy to help on this ๐
Got a last question: in checkout session it's not possible to force the credit card to be the default one for the customer ?
In case he add multiple credit card from multiple session, to force the latest one as the default (so future subscription will use it to charge invoices)
No, you would need to manually set Customer's invoice_settings.default_payment_method: https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method
Great, that's can be a very good option to the checkout session, to avoid a lot of code in our side to handle this simple case