#PROCESSORDUMBLECORE
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
You can use the PaymentElement, of course: https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements
Hello Vanya, thank for you answer, but when i try to use PaymentElement i catch this error : Invalid value for confirmCardSetup: payment_method.card was payment Element, which cannot be used to create card PaymentMethods.
There my code : //..
if (!stripe ||!elements) {
return;
}
setIsProcessing(true)
const { error } = await stripe.confirmCardSetup(clientSecret, {
payment_method: {
card: elements.getElement(PaymentElement),
},
});
//...
The code looks slightly different when using Payment Element. Please, follow the guide carefully. The confirmation looks like this, for example:
const {error} = await stripe.confirmSetup({
elements,
confirmParams: {
return_url: 'https://example.com/account/payments/setup-complete',
}
});