The code that Novashock supplied does work when you fix the spelling errors of the functions and variables as well as put your actual PayPal credentials in it. The function names must match the names used in the onload function. <script> var url = "https://www.paypal.com/sdk/js?client-id=sb&enable-funding=venmo¤cy=CAD"; var myScript = document.createElement('script'); myScript.setAttribute('data-sdk-integration-source', 'button-factory'); myScript.src=url; document.head.appendChild(myScript); function firstPriceButton(){ paypal.Buttons({ style: { shape: 'rect', color: 'black', layout: 'vertical', label: 'paypal', }, createOrder: function(data, actions) { return actions.order.create({ purchase_units: [{ amount: { value: '50' } }] }); }, onApprove: function(data, actions) { return actions.order.capture().then(function(details) { alert('Transaction completed by ' + details.payer.name.given_name + '!'); }); } }).render('#paypal-button-container-50'); }; function secondPriceButton(){ paypal.Buttons({ style: { shape: 'rect', color: 'black', layout: 'vertical', label: 'paypal', }, createOrder: function(data, actions) { return actions.order.create({ purchase_units: [{ amount: { value: '100' } }] }); }, onApprove: function(data, actions) { return actions.order.capture().then(function(details) { alert('Transaction completed by ' + details.payer.name.given_name + '!'); }); } }).render('#paypal-button-container-100'); }; function thirdPriceButton(){ paypal.Buttons({ style: { shape: 'rect', color: 'black', layout: 'vertical', label: 'paypal', }, createOrder: function(data, actions) { return actions.order.create({ purchase_units: [{ amount: { value: '150' } }] }); }, onApprove: function(data, actions) { return actions.order.capture().then(function(details) { alert('Transaction completed by ' + details.payer.name.given_name + '!'); }); } }).render('#paypal-button-container-150'); } myScript.onload = function () { firstPriceButton(); secondPriceButton() thirdPriceButton() }; </script>
... View more