#morey-payment-method
1 messages · Page 1 of 1 (latest)
This is not about the testing card used, it is more about how payment_method behave in Stripe API.
All the payment_method are single use in nature; once it is used for payment, it could no longer to used again and its status will go to consumed state.
To reuse the payment_method, it needs to be attached to the customer. And to create payment, you will need to pass both the customer id with the payment_method ID.
Once the payment_method is detached from the customer, it will enter the consume status and could not be used anymore.
you will need to create a new payment_method again
To reuse the payment_method, it needs to be attached to the customer. And to create payment, you will need to pass both the customer id with the payment_method ID.
I see, this part is what I am trying to do. Saving Cards for future use
On front-end I have:
payment_method: {
card: cardElement,
billing_details: {
name: cardHolderName,
address: {
line1: cardHolderAddress1,
line2: cardHolderAddress2,
country: cardHolderCountry,
city: cardHolderCity,
postal_code: cardPostalCode,
state: cardHolderState,
},
},```
That will also trigger my backend
```stripe.paymentMethods.attach(
paymentMethodId,
{
customer: customer.data().customer_id,
}
);```
It Should attach?