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

initialize must be called with a new client token before every call to presentDropInPaymentUI, this is a change (android) #7

Open
dvcroft opened this issue May 9, 2020 · 1 comment

Comments

@dvcroft
Copy link

dvcroft commented May 9, 2020

I call initialize once, and then can proceed to call presentDropInPaymentUI one time, but if I try a second time I get an error "The Braintree client must first be initialized via BraintreePlugin.initialize(token)"

Previously I was using https://github.com/taracque/cordova-plugin-braintree.git On that version, I could do one initialize, and multiple presentDropInPaymentUI.

Is the single use behavior on this fork intentional?

I am using a client token which the braintree docs say is good for 24 hours.

Thanks,
Darren

@dvcroft
Copy link
Author

dvcroft commented May 15, 2020

I have verified that with current code, to do two payments you must initialize EACH time with a DIFFERENT client token.

This change is caused by commit 5c6f9c4 on 4/22/18 where the initialization and presentPaymentUI methods where modified. Previously initialize set the token and created a DropInUI request. Currently presentPaymentUI creates a new request each time it is called.

Personally I prefer the original behavior because I only have to request one client token and can re-use it (for 24 hours until it expires). But perhaps the new method is safer.

@dvcroft dvcroft changed the title initialize invalidated after one use initialize must be called with a new client token before every call to presentDropInPaymentUI, this is a change (android) May 15, 2020
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

1 participant