#morey-paymentintents-3ds

1 messages · Page 1 of 1 (latest)

pale ivy
#

Just to make sure I know all the background, is there a particular reason you're using this flow? This is not the default most integrations go through

dense quest
#

Hey sure. It's becuase i have a video call service. and the amount isn't known until end of the call. So i have a build a custom flow.

#

If the checkout fails at end of the call with "require_action" then I want the 3ds to show up on the end_call screen.

Credit cards and stripe customers were created and attached before the call started.

pale ivy
#

Ah I see - so your flow is one where you're charging a saved card later, and you want to make sure you properly handle when additional actions like 3DS are needed?

dense quest
#

yes 😄

pale ivy
#

Gotcha, so the flow you described is close, but not quite correct. You wrote "Client open 3ds link in new tab next_action.use_tripe_sdk.stripe_js", which isn't exactly how it works. With 3DS you should either be using our Stripe.JS library to trigger/display the authentication page for you, or you'll pass in a return_url when you create the Payment Intent to indicate that you want to handle the redirect yourself.

If you want to handle the redirect yourself the flow would go like this:

  1. Customer wants to pay
  2. Server creates a Payment Intent w/ the amount, confirm: true , and set return_url
  3. If additional action is required, redirect your user to the 3DS page specified in next_action.redirect_to_url.url (see https://stripe.com/docs/payments/3d-secure#manual-redirect)
  4. Payment is complete after they've authenticated on the 3DS page
#

Is your goal to handle displaying the 3DS page yourself?

dense quest
#

Well, I just want to display it whenever a charge fails. Which can happen on 2 screen my app.

  1. After a call
  2. Customer depositing to wallet themselves.
#

fails with next_actions*

#

for 2. Server creates a Payment Intent w/ the amount, confirm: true , and set return_url

The object I am getting looks like this:

"next_action":{
      "type":"use_stripe_sdk",
      "use_stripe_sdk":{
         "type":"three_d_secure_redirect",
         "stripe_js":"https://hooks.stripe.com/redirect/authenticate/src_1Jh5GPLXSN9kljfYyiPEXx2S?client_secret=src_client_secret_OLB60Q1uTLhJTUcCZ0gKFSAo&source_redirect_slug=test_YWNjdF8xSGl0SmhMWFNOOWtsamZZLF9LTG1xNlV3VGpRUDJSQ2JiV0t3Q1NoRDlmR2lPc3la0100IR69OVPr",
         "source":"src_1Jh5GPLXSN9kljfYyiPEXx2S"
      }
   },```
#

isn't return_url and stripe_js same?

pale ivy
dense quest
#

Ah i see. So in my payment intent I specify the return_url?

#

let me read the docs

pale ivy
dense quest
#

I have something like this now returned:

return_url should be the page a customer sees right after 3ds success?

"next_action":{
      "redirect_to_url":{
         "return_url":"https://lysterium-web-client-dev.vercel.app",
         "url":"https://hooks.stripe.com/redirect/authenticate/src_1Jhjv1LXSN9kljfYVKx5iGMT?client_secret=src_client_secret_qc8oDcNijRpbvG1UWArBPzle&source_redirect_slug=test_YWNjdF8xSGl0SmhMWFNOOWtsamZZLF9LTVNxUGNPdVNiUzRBNlVkejBad24zNDBiMTFoUDhy0100RsCalZFL"
      },
      "type":"redirect_to_url"
   },
#

If this looks right I'll follow the rest of your process from

2. Server creates a Payment Intent w/ the amount,  confirm: true , and set return_url
3. If additional action is required, redirect your user to the 3DS page specified in next_action.redirect_to_url.url  (see https://stripe.com/docs/payments/3d-secure#manual-redirect)
4. Payment is complete after they've authenticated on the 3DS page
hasty fossil
#

yes that' correct

#

and url is where you send them and return_url is where they come back after 3DS