#Naveed | Web3Auth - PaymentMethod

1 messages · Page 1 of 1 (latest)

hollow fog
#

👋 Thanks for reaching out

turbid flower
#

Is there any way I can do the confirmSetup and assign it as default on server side.

E.g. atm im using Stripe elements so my client-side code is doing the following

await this.stripe.confirmSetup({
        elements: this.elements,
        redirect: "if_required",
        confirmParams: {
          payment_method_data: {
            billing_details: {
              email: "gg@gg.com",
            },
          },
        },
      });

the response does return the payment method id which as you mentioned i can utilise to update my customers default payment method

#

But im thinking perhaps id like to do this on server side so something like myServer.confirmSetup and in that on server side i would do both the confirmation and the assigning default

#

but idk how this would work out since stripe.confirmSetup makes use of elements as a param

hollow fog
turbid flower
#

hmm really, the confirm endpoint seems to return this

#

payment_method

hollow fog
#

I miss understand you question so, then you can use it directly after confirming the SetupIntent

hushed hornet
#

Hi! I'm taking over this thread.

#

But im thinking perhaps id like to do this on server side so something like myServer.confirmSetup and in that on server side i would do both the confirmation and the assigning default
Technically it's possible to confirm a setupintent server side with https://stripe.com/docs/api/setup_intents/confirm
But it the payment method require actions (like for 3DS), then it will have to be done on the frontend. That's why we recommend doing the confirmation directly on the frontend.

turbid flower
#

Ahhh I see... it's crystal clear now thank you guys!