Skip to content

Instantly share code, notes, and snippets.

@braintreeps
Created October 28, 2019 21:24
Show Gist options
  • Save braintreeps/9c398420a73c5a07d48a069b01b1d42f to your computer and use it in GitHub Desktop.
Save braintreeps/9c398420a73c5a07d48a069b01b1d42f to your computer and use it in GitHub Desktop.
Deferred client blog post 2
<!-- include only the hosted fields script to the page -->
<script src="https://js.braintreegateway.com/web/3.53.0/js/hosted-fields.min.js"></script>
<script>
// pass the authorization directly into Hosted Fields
braintree.hostedFields.create({
authorization: 'client_token_or_tokenization_key'
// the rest of the Hosted Fields configuration goes here
}, function (hostedFieldsErr, hostedFieldsInstance) {
// finish by adding event listeners to trigger tokenization requests on a button click
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment