Skip to content
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

paymentMethodRequestable/paymentMethodIsSelected with 3DS #805

Closed
Labels

Comments

@ae-michal-mordarski
Copy link

General information

  • SDK/Library version: 1.33.0
  • Environment: Sandbox
  • Browser and OS: Latest version of Chrome/Windows 10 Pro

Issue description

Per documentation paymentMethodIsSelected will be true any time a payment method is visibly selected in the Drop-in UI, however with 3DS enabled you get false first as expected, followed by true right away, but 3DS pop-up is shown, so technically speaking payment method is not visibly selected until 3DS is completed.

Furthermore, we have another logic that depends on paymentMethodIsSelected being true when saved credit card is selected, thus making it impossible to distinguish, because true also comes while 3DS pop-up is visible.

https://braintree.github.io/braintree-web-drop-in/docs/current/Dropin.html#~paymentMethodRequestablePayload

  1. Enter credit cards details which requires 3DS
  2. requestPaymentMethod (3DS pop-up is shown and card is not selected)

Expected result: paymentMethodIsSelected is true when 3DS is completed
Actual result: paymentMethodIsSelected is true when 3DS popup is shown

instance.on('paymentMethodRequestable', function (event) {
	if (!event.paymentMethodIsSelected) {
		console.log('requestPaymentMethod')
		instance.requestPaymentMethod(
			{
				threeDSecure: getThreeDSecure(),
			},
			function (err, payload) {
				if (err) {
					instance.clearSelectedPaymentMethod();
					return;
				}

				console.log(payload);
			},
		);
	}
	else
	{
		console.log('paymentMethodIsSelected')	
	}
});
@jplukarski
Copy link
Contributor

Hey @ae-michal-mordarski , thank you for reporting this and your patience while we look into this. We agree that it makes sense for the paymentMethodRequestable event to not report paymentMethodIsSelected as true until the 3DS challenge is completed. We have this task on our radar and will update this issue once the fix is in place.

@ae-michal-mordarski
Copy link
Author

@jplukarski nice, I'm glad I'm able to help this way.

@jplukarski
Copy link
Contributor

This bug has been fixed in version 1.42.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment