#remrem_code

1 messages ¡ Page 1 of 1 (latest)

plucky sierraBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1407344191947669606

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

quick anchor
#

hi there!

#

with off_Session: true, if 3DS is required the payment will fail. then you can ask your customers to come back on session and retry the payment.

blissful basin
#

But how the workflow will looks like from client side? we use react native.
Can we do following:
Add this to the backend then we creating the payment intent.

  card: {
   request_three_d_secure: "any",
  },
},

Then return an error to the client

if (paymentIntent.status === "requires_action") {
              // Return a specific error that frontend can handle
              throw new ApolloError(
                "Payment requires authentication", 
                "AuthenticationRequired",
                {
                  localizedMessage: "errors.server/payment-requires-authentication",
                  paymentIntentId: paymentIntent.id,
                  clientSecret: paymentIntent.client_secret,
                }
              );
            }

Somehow handle it's 3d secure verification and pass paymentIntentId to the backend again?

quick anchor
#

But how the workflow will looks like from client side?
which workflow? retry the payment after it failed off session?

blissful basin
#

Do you mean that if we request 3ds with off session payment it will fail and we cannot complete 3ds secure no longer?

#

Let me a bit clarify that we are trying to achive. Now we save card for future usage and user make payments with off-session.

We want to make following:
Then the payment amount is more than 200, we want user to pass through 3ds verification. But i am not sure is it possible to do with off-session or that is the recommended way of doing it

quick anchor
#

if you create a PaymentIntent with off_session: true and the bank request 3DS, then you'll get back an error "Your card was declined. This transaction requires authentication", and the PaymentIntent status will be requires_payment_method.

#

you cannot force 3DS to occure. it's up to the bank to device if they want to ask for 3DS or not.

#

but if you try to make the payment off-session, then Stripe will ask for exemptions from 3DS, since the customer won't be able to complete the 3DS flow. but still, the bank may ask for 3DS, and in this case the payment will simply fail.

blissful basin
#

But can we somehow implement a flow then we can handle this 3ds secure on the client side?(if it asked from the bank)

quick anchor
#

absolutely, you should! creating a new PaymentIntent (or reusing the same one), with off_session: false. you would get a PaymentIntent in a requires_action status.

#

then you need to tell the user to come to your website/app, and confirm the PaymentIntent on the frontend to trigger the 3DS flow.

blissful basin
#

So basically it will looks like

 const paymentIntent = await stripe.paymentIntents.create(
              {
                amount: rental.totalPriceAmount,
                currency: env.COUNTRY_CURRENCY,
                customer: rental.borrower.stripeCustomer,
                payment_method: paymentMethodId,
                off_session: false,
                confirm: true,
                capture_method: "manual",
                payment_method_options: {
                  card: {
                    request_three_d_secure: "any",
                  },
                },
              },
            );

When we can pass the paymentIntent.id to the client and handle 3ds secure on the client side?

quick anchor
#

and you want to use React Native for this?

blissful basin
#

Yes

quick anchor
plucky sierraBOT