Talk about features that would help Single Page Apps
See original GitHub issuebraintree-web
’s design comes from a time when checkout flows generally used a <form>
POST. This is no longer the case in 2015, where SPAs and JS-heavy checkout flows are common.
There are a couple things that keep braintree-web
from working well in SPAs, the biggest of which is that braintree.setup
can only be called once per page load.
I’m starting this thread to discuss what kinds of features would be useful for making braintree-web
work better in JS-heavy checkout flows.
Related Issues:
- setup() with different user #18
- Ability to disable dropin form event handlers #4
- paymentMethodNonceReceived callback doesn’t get a new nonce after submitting and re-entering number #20
- paypal support? https://github.com/jeffcarp/braintree-angular/issues/8
Issue Analytics
- State:
- Created 9 years ago
- Comments:93 (13 by maintainers)
Top Results From Across the Web
What is Single Page Application? Pros and Cons with Examples
A single page application is easy to deploy compared to multi page application. Brands like Gmail and Facebook uses SPA. Know more about...
Read more >Single-Page Apps: Advantages, Pitfalls, and Best-for ... - Apriorit
In this article, we discuss advantages and disadvantages of single-page applications as well as popular JavaScript frameworks for SPA ...
Read more >Comprehensive Guide to Single Page Applications - HUSPI
In this article, we'll talk about what is Single Page Application (SPA), what benefits SPA brings to users and businesses, how it works...
Read more >What Are Single Page Applications? Examples, Frameworks ...
Gmail, Facebook, Trello, Google Maps, etc., all are Single Page Applications that offer an outstanding user experience in the browser with no page...
Read more >Key Benefits and Pitfalls of Single-Page and Multi-Page Apps
Multi-page apps can include as much information about products or services as required, with no page limitations. Single-page applications don't ...
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 FreeTop 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
Top GitHub Comments
I ended up “solving” this by using an iframe. It might not seem clean but it works perfectly fine and there are no left-overs.
I’m creating a new iframe, injecting html that includes the form and script setup for braintree with the Client Token using
javascript:window["content"]
.Then every callback of braintree’s drop-in (onPaymentReceived, onReady, onError) is handled by using
Window.postMessage()
on the main application window.Every time you need to create a new drop-in with a different Client Token, you just remove the iframe, and re-create it. This is untested as far as older browsers go but it works perfectly fine on Firefox and Chrome.
Let me know what you think.
@parreirat glad to hear it helped out!
Also, good call on posting the documentation in this thread, that slipped my mind!