-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3DS Result Object Refactor #845
Conversation
@@ -0,0 +1,46 @@ | |||
{ | |||
"formatVersion": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember seeing this json schema file in another PR. Is it supposed to be in this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah no - it was merged in with another PR so now removed 👍
private void handlePaymentMethodNonceCreated(PaymentMethodNonce paymentMethodNonce) { | ||
super.onPaymentMethodNonceCreated(paymentMethodNonce); | ||
|
||
final FragmentActivity activity = getActivity(); | ||
if (!threeDSecureRequested && paymentMethodNonce instanceof CardNonce && | ||
Settings.isThreeDSecureEnabled(activity)) { | ||
Settings.isThreeDSecureEnabled(activity) && !(paymentMethodNonce instanceof ThreeDSecureNonce)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
random: Always felt like it would make sense to give 3DSecure its own Demo fragment one day.
ThreeDSecure/src/main/java/com/braintreepayments/api/ThreeDSecureClient.java
Outdated
Show resolved
Hide resolved
…ureClient.java Co-authored-by: sshropshire <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loving the single result object in favor of the result and error params 🙌
Co-authored-by: Tim Chow <[email protected]>
Summary of changes
ThreeDSecureResult
object was used throughout the flow to contain the lookup and nonce after the initial lookup call, and after the completion of authentication flow.ThreeDSecureResult
object into aThreeDSecureParams
class - used to launch theThreeDSecureLauncher
, and made all fields exceptThreeDSecureLookup
private on that class (so merchants can still access intermediate lookup params if desired).ThreeDSecurePaymentAuthRequest
object with aReadyToLaunch
state that contains theThreeDSecureParams
, and aLaunchNotRequired
state that represents a successful 3DS flow where no additional authentication challenge was required. TheLaunchNotRequired
containsnonce
andlookup
. Thenonce
andlookup
also do exist on theThreeDSecureParams
object, but for integration clarity they are separated.ThreeDSecureResult
for the completion of tokenization (full auth challenge completion), which just returns anonce
on success - through testing it appears that we don't receive thelookup
from this API call, so it is not returned again here.Open to suggestions on any changes to make the integration pattern more clear
Checklist
Authors