#gr_dev

1 messages · Page 1 of 1 (latest)

ornate briarBOT
bronze rock
#

Hey! Are you seeing a specific error? What is happening that is unexpected?

fervent pier
#

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.

bronze rock
#

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?

fervent pier
#

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.

`

bronze rock
#

You said you were using Checkout? Which API call throws these errors?

fervent pier
#

I'm using stripe checkout API and conform from the client side.

bronze rock
#

Can you share some examples please

fervent pier
bronze rock
fervent pier
#

Here is my request id: req_WHVoztUkjKeYKC

bronze rock
#

Ok, great. So you create the session, and it gets paid. Then what do you do next?

fervent pier
#

I want to set default PM to the customer.

bronze rock
#

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

fervent pier
#

When i have set this parameters and mount the stripe payment element we can't see BNPL payment method.

bronze rock
#

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

Learn about the different ways to integrate payment methods.

fervent pier
#

OKay,
Thank you

#

Can i ask a one question?

bronze rock
#

Of course!

fervent pier
#

How can i get or use sessions.create line_items in my application for generate receipt manualy?

bronze rock
#
stripe.checkout.sessions.retrieve('cs_xxx', {
  expand: ['line_items']
})