Reputation: 1673
I am working on recurring payment intent, when i am trying to Charge the saved card later Server-side
, I am getting this response :
Array
(
[error] => Array
(
[message] => You cannot attach a PaymentMethod to a Customer during PaymentMethod creation. Please instead create the PaymentMethod and then attach it using the attachment method of the PaymentMethods API.
[type] => invalid_request_error
)
)
for that i have use curl method
curl https://api.stripe.com/v1/payment_methods \
-u ********: \
-d customer="{{CUSTOMER_ID}}" \
-d type=card
Can anyone please help me how to resolve this issue ? I have refer this page
https://stripe.com/docs/payments/save-and-reuse
Upvotes: 7
Views: 2885
Reputation: 76
I encountered the same problem.. according to their docs, we need to first create a payment method and then attach it with the customer. Though, don't know then why they have provided customer field
Upvotes: 5