Issue with reloading Dropin with different payment methods
See original GitHub issueGeneral information
- SDK/Library version: 1.30.1
- Environment: Sandbox
- Browser and OS: Firefox 89.0.2 in Mac OS 11.4 and Safari 14.1
Issue description
- Try to
dropIn.create()
with, for example,paypal = { ... }
and Credit Card dropIn.create()
again but just with Credit CarddropIn.create()
once again but addpaypal = { ... }
with Credit Card- You will only get Credit Card and PayPal will not show, despite the fact that you requested it.
This happens whether you reload the window or not. It seems like you have a timeout to get PayPal back again. It happens with applePay = { ... }
as well. The issue also happens if you always try to dropIn.create()
with paypal = { ... }
and Credit Card, but instead switch paymentOptionPriority = ['paypal', 'card']
to paymentOptionPriority = ['card']
and back again. If you try to justpaymentOptionPriority = ['paypal']
after paymentOptionPriority = ['card']
you’ll get an error saying that DropinError: No valid payment options available
.
I think this is related to the server not wanting to give different payment methods rather than the FE implementation of this repo. Still gotta ask whether this behaviour is supported or if it’s an issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
All payment options failed to load · Issue #708 - GitHub
name: DropinError, message: All payment options failed to load. We are seeing this in our production environment, and have been unable to ...
Read more >Reload Braintree Drop-In UI After Payment Method Delete
You can reload the Drop-in UI by using the teardown method on the Drop-in instance, followed by a subsequent braintree.dropin.create() call. The ...
Read more >Web Drop-in integration guide - Adyen Docs
Accept popular payment methods with a single front-end implementation. ... uses the payment session data to make the payment request and to handle...
Read more >braintree-web-drop-in - Documentation
When your form is submitted, Drop-in will intercept the form submission and attempt to tokenize the payment method. If the tokenization is successful, ......
Read more >Fix issues when you pay for Google products & services
Error codes: OR-CCSEH-22; OR-HDT-14 · Error messages: “[Your payment issuer] declined your payment.” “Correct this card info or try a different card.” “ ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK, I see the problem now. You’re not waiting for the modifications to the
createProperties
to be completed before creating the Drop-in instance. Basically, you’re modifying thecreateProperties
after creating a Braintree client instance and Apple Pay instance, which means that the version of the object that gets passed intodropin.create
does not have those modifications yet. Sometimes they get applied, because the object is mutated before they are accessed in the Drop-in create code, but sometimes they don’t so Drop-in is created with an object that does not have PayPal/Apple Pay applied andcard
set tofalse
.You shouldn’t even be using
braintree-web
in conjunction with Drop-in, so by simply removing the extrabraintree-web
code, you can solve your problem.Here is the code you have on your site right now:
You can change it to this, and it should just work:
Since this isn’t an issue with the Drop-in, if you need further assistance with your integration, please reach out to our support team. https://developer.paypal.com/braintree/help
Fixed that cart issue. Sorry for the wait.