scrimba
Braintree Drop-in UI PayPal
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Braintree Drop-in UI PayPal
AboutCommentsNotes
Braintree Drop-in UI PayPal
Expand for more info
index.html
run
preview
console
<html>
<head>
<script src="https://js.braintreegateway.com/web/dropin/1.10.0/js/dropin.min.js"></script>
</head>
<body>
<div id="dropin-container"></div>
<button id="submit-button">Pay</button>

</body>
<script>
let button = document.querySelector("#submit-button");

braintree.dropin.create({
authorization: "sandbox_tj235dtb_55fq56mnmqf6wz2x",
container: "#dropin-container"
}, function(createErr, dropin) {
if(createErr){
console.log(createErr);
}
button.addEventListener('click', function (){
dropin.requestPaymentMethod(function (requestPaymentMethodErr, payload){
if(requestPaymentMethodErr){
console.log(requestPaymentMethodErr);
}
console.log(payload);
});
});
});
</script>
</html>
Console
index.html
-5:33