<div id=”paypal-button”></div>
<script src=”https://www.paypalobjects.com/api/checkout.js”></script>
<script>
paypal.Button.render({
env: ‘sandbox’,
client: {
sandbox: ‘demo_sandbox_client_id’
},
payment: function (data, actions) {
return actions.payment.create({
transactions: [{
amount: {
total: ‘0.01’,
currency: ‘Euro’
}
}]
});
},
onAuthorize: function (data, actions) {
return actions.payment.execute()
.then(function () {
window.alert(‘Thank you for your contribution!’);
});
}
}, ‘#paypal-button’);
</script>