#alexanderg-payment-method
1 messages ยท Page 1 of 1 (latest)
HI ๐ the biggest advantage is that then the payment method can be reused for other payments for that customer. If it's not attached to a customer then it's single-use.
Is there a downside of attaching a payment method to customer?
... the use case we have is basically a shopping cart style business where users enter the card before checkout.
None that I'm aware of.
Basically if I use setup_future_usage while creating payment intent then I will be able to use it in the future as it attaches the payment method to customer?
setup_future_usage is something a bit different. That tells us to prepare the payment method to be used for off_session payments, in which case we'd request exemptions from SCA/3DS flows.
That's discussed a bit more here:
https://stripe.com/docs/payments/save-during-payment?platform=web
What would be the best way for us to attach payment method to customer, ideally during create payment intent Stripe API call (auth only, not capture).
Apologies, I was off earlier, setup_future_usage is the parameter to use for this. Out of curiosity though, do you plan to capture the payment later, or are you trying to just do the auth?
So the scenario we have is as follows: 1. auth only, then 2.a. capture (if within 7 days), or 2.b. reauth and capture (if > 7 days - auto cancelled). We need the reuse of payment method for step 2.b. Would setup_future_usage be the best option here if we want to reuse the payment method from step 1?
Yes it would be.
off_session is fine? the customer is not present, its done by our back office staff
Yes, off_session is what you will want to use to indicate they aren't present when the funds are captured
@orchid panther I asked to toby already but is there any downside to using this to your knowledge?
ie using setup_future_usage vs not using it
Not that I can think of either. Can you clarify what the "reauth" part of step 2b is here?
It means that we initially auth the card (eg for 500$) then wait to capture. Sometimes capture takes place after 7 days, so the original auth expires. In this case we need to auth and capture the card again (for 500$) which is not done by customer but by our back office staff. So the hope is if we do use setup_future_usage during the initial auth, then we can use the same payment method and all the other info to do auth and capture after 7 days. In which case we would get a new payment intent (the original one being auto cancelled).
The key for us to be able, in case reauth and capture fails, to try it again with the same payment intent, ie work with FAILED state, which I assume can only be done if payment method is attached to customer.
My understanding is that setup_future_usage is what attaches payment method to customer to allow the above
... to clarify we do reauth and capture past 7 days already but if it fails we cannot just 'try' again with the same payment intent. This is why I thought setup_future_usage would help
Yes, that is definitely the way you want to use those parameters then
Set up future usage and on site for the first auth and then off site for the subsequent ones
Also if you haven't already, I would write in to support about longer auth windows. They are only available for certain industries (as determined by card issuers) but our support may be able to help you if that is applicable to you
About longer Stripe auth window, ie beyond 7 days?
Hey @bold canopy
following up on this thread about auth beyond 7 days, yeah that's what Pompey meant.
On our end it shows there's no way to extend it beyond 7 days but if you reach out to support and see if there are any betas, private features or anything as such just to reconfirm.
Sounds good ๐
And one more question, once payment intent is in Failed state (and given it is assigned to customer) which API method do I use to retry it?
looking into it
apologies for the delay
juggling between multiple threads
Apologies I dropped off this thread for a bit. What do you mean by a failed state here?
If you are talking about after the initial hold window, that would just be repeating step 1 and creating an entirely new intent. https://stripe.com/docs/payments/capture-later#authorize-only
Otherwise for requires_payment_method you will want to direct the user to add a new payment method for requires_action you can direct them to the next action they have to take https://stripe.com/docs/payments/intents
Not after initial hold window. For example we try a payment method auth/capture and it failed with insufficient fund. The client fixed the issue and in one hour we want to try again on the same (failed) payment intent (not create a new payment intent or payment method).
e.g., of failed pi https://dashboard.stripe.com/test/payments/pi_3KJO4JI7FT03hK3l01C7ntb6
So basically we want auth and capture on the same intent without changing any info, just a retry after a few hours
So unfortunately it's not possible to use the same payment method on that payment intent. You can use the same payment intent but would just have to switch the payment method
I thought if the payment method is attached to customer I can use it again?
It would be as the initial call will be with setup_future_usage (please let me know if it is incorrect)
My question is what API method can I use to again retry the same payment intent (with same info as initially including same payment method)
... the one that failed at first
You can't, that's the thing, it's impossible. If the previous attempt failed, card details get dropped, we don't "save" a PaymentMethod that failed. So you need to re-ask for card details again
I was told in this thread that if the payment method is attached to customer I can, is it not what you listed above.
Also I have the payment method and other info from the original call handy (in my DB)
What does that mean? You have the raw card number, expiration date and CVC? Because that breaks PCI compliance
I have the payment method id , eg
pm_1KJO4JI7FT03hK3lIcMqb0sU
no card info
Basically again - I have payment intent that failed and I want it to succeed by trying again. How can I do it using the Stripe API and without the card details (#, expiry, cvc...) but with all the details from the original call. e.g....
{
"amount": 100,
"applicationFee": 10,
"authorizeAndCapture": true,
"description": "abc",
"idempotencyKey": "3344571239871234",
"metadata": {},
"metadataMap": {},
"paymentMethodId": "pm_card_chargeDeclinedExpiredCard",
"paymentType": "P2P_VEHICLE_PAYMENT",
"paymentsPartyDestinationId": 278668,
"paymentsPartyId": 278669,
"platform": "DIGITAL_RETAIL",
"receiptEmail": "agelberg@cargurus.com",
"statementDescriptorSuffix": "suff"
}
But you have to understand that you can't with the flow you are using. It's doable but highly discouraged, don't try that
I can explain but if I explain, then you'll just ignore what I said and do it anyway, which will be bad for your business
the first time you accept a payment, you collect card details online, the payment synchronously fails, we don't attach/save the PaymentMethod, since it failed and we expect you to retry in the future by asking the customer for updated card details
So is it bad to have payment method attached to customer and redp it?
that is the canonical flow you should use
If we no longer have the access to customer card and the payment intent fails, what can our back office staff do to retry the same card?
It looks like a pretty standard feature - e.g., customer had his limit exceed and fixed it and we want to try again the card.
I'm sorry, you seem to be mixing things up but I'm not succeeding at explaining why
If John doe pays $10 on Monday and it works, you get pm_123 attached to customer cus_123 and you can re-use that card in the future.
If they attempt to pay on your website for the first time on Monday, and it fails, nothing is saved. Nothing should be saved. Your staff shouldn't just retry a payment 3 days later without telling your customer in any way. They tried to pay, you told them it failed, that's the end of the payment
John Doe only does the auth of $10 (not capture) but our staff does the capture (when customer gets the goods), this is payment intent #1. Now, if capture is beyond 7 days it cannot be done. So backoffice staff does auth/capture of $10 (new payment intent #2). Now if auth/capture fails we would like to try it again after an hour or so (with the same payment intent #2, instead of creating a new one #3 with another auth/capture).
Yeah I don't get that sentence at all I'm sorry. What is failing? What's past 7 days?
If the auth succeeds it should attach the PM
Yes, auth succeeds and can attach the PM. After 7 days pi #1 gets auto cancelled (no capture takes place), this is why we need pi #2
These are the steps
- auth by client succeeds, payment intent #1
- payment intent #1 is cancelled (expires) capture cannot take place
- new payment intent #2 auth/capture is created by office staff but fails (e.g., no funds on card)
- we need to retry (auth/capture) payment intent #2, how can we do it without involving the client and his card.
But that doesn't add up to what you said earlier. Step #4 happens after the card has already been authorized successfully (step #1) and automatically attached to the customer
between #1 and #4 the card can run out of funds
that doesn't matter at all to the flow at hand
again, doesn't matter
card was successful at step 1
Let's pause. Now that I understand your flow, can you give me an example request id that fails?
ok, so what should I do if at step 3 the card fails. yes, one sec...
You just retry again to confirm the same PI id with the original pm_123 that worked at step 1
https://dashboard.stripe.com/logs/req_NQlBphrl3e01l6 this is your request. You create and confirm the PI with an already attached (previously) PaymentMethod
All you have to do here is call https://stripe.com/docs/api/payment_intents/confirm again and pass the same PaymentMethod id in the payment_method parameter and it will work (as in it will try that card again, you might still get a decline)
Great, thank you! ๐
sorry for all the hassle. It looked like you wanted to do this where the first PI is the one failing and the card never gets "attached"