#mike35x95x1-setup_future_usage
1 messages ยท Page 1 of 1 (latest)
hm, how can I retrieve it?
In your Dashboard request log. It's req_xxx
looking for the right one, give me a moment
I'll try to create a new one. just a moment
pi_3LaEDTI9dUljRHPm0VDX7bof
just created. I can see there "setup_future_usage": 'off_session'
can you please confirm?
I used brand new card (Brazil card) that I've never used before and it tells me the same error
4000000760000002
Okie I can see you created the PI. Can you confirm the PI?
after it's confirmed we would see the PM attached
You have 2 steps: create a PI then confirm it via a client library, normally stripe.js
I am reading it (https://stripe.com/docs/api/payment_intents/confirm). So the flow is like this?
- create PI
- confirm PI (purpose...?)
- checkout
- pm attached to a customer?
or is the confirmation used only when I want to use the pi to collect money without customer action?
You should follow this one: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
we have this done already
we have two different flows. with a new card and with existing card. but in both the card is not attached to the customer.
so do I need to confirm the PI only when I create it with a payment_method_id or even when we send the customer to the checkout page?
frankly speaking - should I confirm EVERY pi or only some...?
I'm not really following your thoughts. No you don't need to confirm every PI, but I am unsure about your 2 flows
Here is the flow to utilize the setup_future_usage. You can see in step 6 you confirm the PI on client side
clarification: we sell software subscriptions and when the card is used for the first time we store its id in our system. on the software renewal we want to create pi with this card (pm) to not involve the customer anymore
it probably does but we want to try it first without. we have all the subscription features in our system already. I don't say we will not use it in the future but not for the time being
I am reading the last link but there is nothing about "confirming paymentIntent". however there is confirm: true on pi creation
Hey, taking over here. Can you clarify the ask for me? Sounds like you're having issues using s_f_u?
hi, it seems I becoming lost in your documentation ๐
I am trying to this simple scenario:
- do first payment with brand new card
- save the pm_id in our system
- create new paymentIntent with this card
- collect the money without customer action
Ok, perfect! You want to look at this guide then: https://stripe.com/docs/payments/save-during-payment
What was the problem?
You don't need to use auto PMs for this flow no, its just our recommended path now
ok. that's becauses it was suggested in the previous provided link
so back to the {confirm: true}. Still don't know if this should be in both (first purchase or only on the repeating one)
Can you share a pi_xxx ID with me that's proving troublesome?
"pi_3LaEnRI9dUljRHPm13kLdMzV"
just have created it with a new mexico visa card
"pm_1LaEnuI9dUljRHPmJlNDsCfi"
there are no pms on cus_MCthNndyc0ak1o
Ok, looks like the PI succeeded. And the intention was for that Payment Method to be saved to this customer: cus_MCthNndyc0ak1o ?
Yep, you're missing the payment_intent_data.setup_future_usage param in your session creation: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and it's back:
I tried to create new pi with the pm_1LaEnuI9dUljRHPmJlNDsCfi for a cus_MCthNndyc0ak1o and get the error message. can you please clarify what exactly I did wrong in this case?
Can you share the req_xxx ID that threw that error
how can I retrieve the req_xxx from a fail request? I only have an exception in my code
I can provider the payload I am sending to the stripe.paymentIntent.create if it helps...
this is what I am sending:
{
amount: 2500,
currency: "EUR",
description: "Muse Thing Standard Subscription (monthly)",
customer: "cus_MCthNndyc0ak1o",
payment_method_types: [
"card",
],
payment_method: "pm_1LaEnuI9dUljRHPmJlNDsCfi",
setup_future_usage: "off_session",
confirm: true,
}
and I get the error above. I really don't know what I am doing incorrectly
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Why are you passing setup_future_usage: "off_session" again? That's likely the issue
so I should not use it when I am sending pm and confirm?
req_kiO7ITKlutszSs
that's the failed request
I removed it from the request but the result is same: req_oIZKmC0MVRXTzP
So yeah, that PM was created from a Checkout Session before you passed s_f_u: https://dashboard.stripe.com/test/logs/req_lIVCd1TUa7S2c0
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
In that instance its not reusable as it wasn't saved to the customer
i am confused
this is what I do:
- create pi with the s_f_u
- redirect the customer to pay THIS pi
- capture the webhook of the checkout sessions
- retrieve the pi and the pm
- save the pm to our database
- create new pi with the pm and want to collect the money without customer action
where exactly I do have the problem?
But pm_1LaEnuI9dUljRHPmJlNDsCfi wasn't created with s_f_u. That's the issue โ its not reusable
Check the link: https://dashboard.stripe.com/test/logs/req_lIVCd1TUa7S2c0
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Are you passing payment_intent_data.setup_future_usage when you create your Checkout Sessions?
not sure - a moment
No, because they're only reusable if saved. This pm_xxx was used in the initial Checkout
That message is the underlying issue
so even I have pi with the s_f_u I still have to send same parameter to the checkout.session.create...?
You don't have a PI with s_f_u though. This PM, pm_1LaEnuI9dUljRHPmJlNDsCfi, was created by Checkout here: https://dashboard.stripe.com/test/logs/req_lIVCd1TUa7S2c0
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You need to pass that param to Checkout, and then in the Payment Intent for the subsequent payments, you can use the pm_xxx and can omit s_f_u
wait a minute. maybe the problem is elsewhere. this is how I create the checkout session. Don't I miss the pi in the payload?
I thought that the checkout session is created with a link to pi where all the "rules" are set
You need to pass the setup_future_usage under payment_intent_data there
I've said this like 3 times haha
yes I know it now. believe or not - you're in your API docs everyday - for us it's one of many...
so the s_f_u will be used only in the checkout session and the pi will have only pm (if available) and confirm: true, am I correct?
Correct, yes
s_f_u will save the card details to the cus_xxx provided (or created) and the resulting pm_xxx can be reused: https://stripe.com/docs/payments/save-during-payment?platform=web#charge-saved-payment-method
yes, it is understandable. I was just confused "when" or "in which object" I should use it.
however now it looks like I know and I can move forward. thanks for your help
np!
last question? is it possible to send pi_id to checkout session? or how does the checkout session know which pi is connected to?
It's not, no. Checkout will generate a PI
so I don't have to create PI before? this probably is my first misuse
so it's checkout (customer interaction) OR pi + pm + confirm (without customer interaction), right?
You don't nope, Checkout will generate a PI when required and you can pass parameters to that PI (via payment_intent_data)
Basically, yes. The off-session (i.e. no customer present) is a PI creation with customer, payment_method, confirm: true and off_session: true parameters: Here: https://stripe.com/docs/payments/save-during-payment?platform=web#charge-saved-payment-method
You'd use Checkout to process an initial on-session payment which also saves the card to facilitate those future off-session payments