I am trying to get my head round the Hosted Fields framework of Braintree. It has been released just a few days ago and is still in beta.
I looked at the docs. I'm getting the overall idea but it would be nice to have some sort of small working example to start with. I found a github repo but the code does not seem to be working.
Google search did not deliver anything of value (just articles commenting on the idea). Can you point me to a working example (preferably one using rails) ?
Hosted Fields is a way to accept credit card payments securely using our JavaScript SDK, while staying in control of the style of your desktop and mobile website checkout UI.
Hosted Fields are prebuilt but customizable fields that accept customer card data, from which a single-use token is created to use as payment instead of the sensitive data. The token can then be stored so that the non-sensitive data can be reused, making future purchases easier for your customers.
I work at Braintree and was one of the developers on the Hosted Fields team. Glad to see so many people using it!
I made a GitHub repo that should answer your question. Basically, you have to set up Braintree on the server, create a client token, and then pass that client token to braintree.setup
in the JavaScript.
The bulk of the Hosted Fields work happens in the "new transaction" view.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With