#luccccas

1 messages ยท Page 1 of 1 (latest)

bronze sealBOT
final socket
#

๐Ÿ‘‹ happy to help

grand anvil
#

Hi ๐Ÿ‘‹

Some more information: I'm using Stripe elements to display a "Update payment" snippet in my web application.

Currently, we do offer CashApp to our customers, but I'm having trouble capturing the error in test mode

final socket
#

@grand anvil all yours again

grand anvil
#

@final socket No, not really, I wasn't following that guide.

But my implementation is pretty similar to that:

const { error } = await stripe.confirmPayment({
      elements,
      redirect: "if_required",
      confirmParams: {
        save_payment_method: true,
        return_url: window.location.href,
      },
    });
final socket
#

if you read the comment in the if(error) block from the link I sent you

#

This point will only be reached if there is an immediate error

grand anvil
#

I see, so CashApp error is not considered an immediate error

#

Question: is there a way to identify an "immediate success" from stripe.confirmPayment?

final socket
#

it depends on the type of the payment method

bronze sealBOT
grand anvil
#

I'm thinking ๐Ÿ˜„

grand anvil
#

Guess in my case relying on paymentIntent.status = succeeded is enough

#

Sharing more of what I'm thinking, please chime in if you feel like it might drastically affect the logic

Success criteria = Boolean(error) === false && paymentIntent.status === "succeeded"

Error criteria = Boolean(error) === true || paymentIntent.status === "requires_source" (maybe change the latter to paymentIntent.status !== "succeeded")

fossil perch
#

Hello taking over here

#

Not sure I understand the question