#gr_dev
1 messages · Page 1 of 1 (latest)
Hey! Are you seeing a specific error? What is happening that is unexpected?
When i atteched Pm to the customer its throw error:
This PaymentMethod was previously used without being attached to a Customer or was detached from a Customer, and may not be used again.
Yep, is expected. Once a pm_xxx has been used in a payment without being attached you can't then attach it
What exactly are you trying to doing? Which APIs are you using?
and set to default PM to the customer its throw error :
`This PaymentMethod was previously used without being attached to a Customer or was detached from a Customer, and may not be used again.
`
You said you were using Checkout? Which API call throws these errors?
I'm using stripe checkout API and conform from the client side.
Can you share some examples please
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can you share the ID (req_xxx) of the API requests? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site 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.
Here is my request id: req_WHVoztUkjKeYKC
Ok, great. So you create the session, and it gets paid. Then what do you do next?
I want to set default PM to the customer.
Your issue is that your session is not configured to save the card/payment method for future payments. You're missing some parameters: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout#save-payment-method-details
You need to add:
payment_intent_data[setup_future_usage]: 'off_session' to your API request
that will save the pm_xxx to the cus_xxx ID you passed automatically, then you can re-use it and set it as the default
When i have set this parameters and mount the stripe payment element we can't see BNPL payment method.
Yep, unfortunately most BNPL methods don't currently support saving: https://stripe.com/docs/payments/payment-methods/integration-options#additional-api-buy-now-pay-later
So when you pass that parameter, we filter out all the ineligible methods that don't support the session parameters
In that case, if you only want to save cards for example, you'd use this parameter in the Checkout Session creation instead: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_method_options-card-setup_future_usage
Of course!
How can i get or use sessions.create line_items in my application for generate receipt manualy?
You need to 'expand' the field when retrieving the object from the API, it's not included in the payload by default: https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
stripe.checkout.sessions.retrieve('cs_xxx', {
expand: ['line_items']
})