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

BraintreeCancelListener#onCancel invoked twice #112

Closed
weefbellington opened this issue Jul 27, 2016 · 4 comments
Closed

BraintreeCancelListener#onCancel invoked twice #112

weefbellington opened this issue Jul 27, 2016 · 4 comments

Comments

@weefbellington
Copy link

I've identified what appears to be a bug in the Braintree Android SDK. It looks like BraintreeFragment#postCancelCallback is called multiple times after the PayPal activity is canceled by the user.

This means that any BraintreeCancelListener that is registered with the BraintreeFragment will receive the BraintreeCancelListener#onCancel callback twice.

If BraintreeFragment#removeListener is is invoked as part of the first onCancel callback, the second cancel event is queued. When BraintreeFragment#addListener is called, the queued event is flushed and BraintreeCancelListener#onCancel is invoked immediately.

Because of this issue, a user may successfully authorize a PayPal future payment, but an app will track it as a cancellation instead. The PayPal payment nonce is never uploaded to our server.

STEPS TO REPRODUCE

  1. ensure paypal app is not installed on the phone
  2. from a client app activity, call PayPal#authorizeAccount(braintreeFragment), which triggers the browser switcher
  3. press the back button to return to the client app activity

NOTES

@weefbellington
Copy link
Author

I should mention the Braintree SDK version that I'm using:

compile 'com.braintreepayments.api:braintree:2.3.3'
compile 'com.braintreepayments.api:data-collector:2.3.3'

@sdcoffey
Copy link

Hey @weefbellington,

Thanks for bringing this to our attention! Pushing a fix for this now. I'll close this issue when it's merged and released.

@lkorth lkorth closed this as completed in 4d0ff99 Jul 29, 2016
@lkorth
Copy link
Member

lkorth commented Jul 29, 2016

@weefbellington thanks for the report. We've pushed a fix to master and will be releasing it shortly.

@lkorth
Copy link
Member

lkorth commented Jul 29, 2016

This was released in 2.3.6.

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

No branches or pull requests

3 participants