#Vikas-PaymentMethod
1 messages · Page 1 of 1 (latest)
Hi there, it means this payment method is already used or attached to another customer.
I am unable to find it.
Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
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.
req_Cmgl0K8txROsb5
{
"error": {
"message": "This PaymentMethod was previously used without being attached to a Customer or was detached from a Customer, and may not be used again.",
"type": "invalid_request_error"
}
}
Actually, I am trying to create subscription in real time when user makes the payment.
I create, product, price, customer and then trying to create subscription
Thanks for the request ID. Upon checking this payment method is already used in this payment intent request https://dashboard.stripe.com/test/logs/req_cX4gR6vOP9NQGc
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Therefore it can't be used again.
If you want to reuse a payment method, you should attach it to a customer after creating the payment method.
I am doing the same. I mean, first I charge the card then I create the customer.
You should attach the payment method to the customer before creating the charge
so that the same payment method can be used for subscription later
Ok. Got you.
Also, please let me know if I need to pass setup_future_usage => off_session
Or I can move ahead without doing this if I create customer first then charge the card?
Hi! I'm taking over this thread.
How do you plan to attach the PaymentMethod to the customer? The best way is to use a SetupIntent instead of a PaymentIntent. https://stripe.com/docs/api/setup_intents