Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

feat: Initial 3DS implementation and handle requires_action status #3904

Closed
wants to merge 2 commits into from

Conversation

julianajlk
Copy link
Contributor

@julianajlk julianajlk commented Feb 1, 2023

REV-3240.

In order for 3DS to happen for the credit cards that require 3DS authentication, on Payment Intent confirmation with Stripe, we can now remove error_on_requires_action=True since MFE will be able to handle 3DS and does not need to error out. A return_url is also provided so the learner can be redirected after 3DS authentication is done on their bank's website.

Note:

  • We'll only record the processor response of a 'suceeded' Payment Intent (or an error). 'requires_action' status will not be recorded in the payment processor response table, but we'll send data to Segment.
  • This will NOT be merged/deployed before the frontend work is done and can handle a Payment Intent with 'requires_action' state.
  • This modified flow does not utilize webhooks yet.

@julianajlk julianajlk force-pushed the julianajlk/REV-3240/three-d-secure branch 8 times, most recently from 9fe9d46 to f085a96 Compare February 3, 2023 14:44
self.record_payment(basket, handled_processor_response)
properties.update({'total': handled_processor_response.total, 'success': True, })
# For payments that require 3DS auth, tell MFE to handle
if 'requires_action' in handled_processor_response._fields:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the requires_action key only show up in the handled_processor_response if it's a 3DS event?

Copy link
Contributor Author

@julianajlk julianajlk Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct, comes from the named tuple I created RequiresActionProcessorResponse vs. the existing HandledProcessorResponse. At this point in the code I don't distinguish btw them (variable name is handled_processor_response) because they both could come from the same handle function.
From my testing if it's not present, it does not error out but happy to modify the code if you find a better way!

@@ -153,6 +153,159 @@
"transfer_data": null,
"transfer_group": null
},
"confirm_resp_three_d_secure": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I need all of this here, the only difference between the confirm_resp is the status.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants