#PROCESSORDUMBLECORE

1 messages · Page 1 of 1 (latest)

sage mesaBOT
devout meadow
#

Hi! Let me help you with this.

untold citrus
#

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),
        },
    });
    //...
devout meadow
#

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',
    }
  });