Skip to content

Instantly share code, notes, and snippets.

@matthewarkin
Created December 28, 2015 22:24
Show Gist options
  • Save matthewarkin/459df9c875a5d955bf3b to your computer and use it in GitHub Desktop.
Save matthewarkin/459df9c875a5d955bf3b to your computer and use it in GitHub Desktop.
<script>
braintree.setup(clientToken, "dropin", {
container: "dropin-container",
dataCollector: {
kount: {environment: 'sandbox'},
paypal: true
},
onReady: function (braintreeInstance) {
$("#deviceData").val(braintreeInstance.deviceData); // advanced anti-fraud
},
onPaymentMethodReceived: function (paymentInfo) {
$("#paymentNonce").val(paymentInfo.nonce);
$("#updateCard").hide();
$("#payment-modal").modal('hide');
if(awaitingPaymentDetails) $("#droneInfo").submit();
}
});
$(".edit-payment-info").click(function(){$("#payment-modal").modal()});
$("#payment-modal").on("hidden.bs.modal", function(){
document.body.style.overflow = ""; // hack to handle Braintree.js bug -- emailed support
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment