// Render the PayPal button
paypal.Button.render({
// Set your environment
env: 'production', // sandbox | production
// Specify the style of the button
style: { size: 'responsive', // small | medium | large | responsive shape: 'rect', // pill | rect tagline: false },
funding: { allowed: [ paypal.FUNDING.CREDIT ] },
// PayPal Client IDs - replace with your own // Create a PayPal app: https://developer.paypal.com/developer/applications/create
client: { sandbox: 'AZDxjDScFpQtjWTOUtWKbyN_bDt4OgqaF4eYXlewfBP4-8aqX3PiV8e1GWU6liB2CUXlkA59kJXE7M6R', production: 'AWUkdUAlHqkGzk9aRWrNA37CicUmxJNtZYYr30J4SjJ8QTAQq55ncxEE7kbCtE5aSOMhC0ZeML9v2RTL' },
// Wait for the PayPal button to be clicked
payment: function(data, actions) {
// Set up a payment and make credit the landing page
return actions.payment.create({ payment: { transactions: [ { amount: { total: '0.01', currency: 'USD' } } ] } }); },
// Wait for the payment to be authorized by the customer
onAuthorize: function(data, actions) { return actions.payment.execute().then(function() { window.alert('Payment Complete!'); }); }
}, '#paypal-button-container');