#Vikas-PaymentMethod

1 messages · Page 1 of 1 (latest)

calm jungle
#

Hi there, it means this payment method is already used or attached to another customer.

lyric lotus
#

I am unable to find it.

calm jungle
lyric lotus
#

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

calm jungle
#

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.

lyric lotus
#

I am doing the same. I mean, first I charge the card then I create the customer.

calm jungle
#

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

lyric lotus
#

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?

modest hawk
#

Hi! I'm taking over this thread.