Skip to content

Instantly share code, notes, and snippets.

@Verikon
Last active August 29, 2015 14:07
Show Gist options
  • Save Verikon/20b7c0c22894384faa9c to your computer and use it in GitHub Desktop.
Save Verikon/20b7c0c22894384faa9c to your computer and use it in GitHub Desktop.
Using PaypalButtons - the online version.
document.addEventListener( 'DOMContentLoaded', function() {
var parentNode = document.querySelector('#paypalButon');
PAYPAL.apps.ButtonFactory.create( 'YOUR PAYPAL ID', {
button: { value: 'buynow' },
name: { value: 'Some Product' },
quantity: { value: '1' },
amount: { value: '5.99' },
currency: { value: 'AUD' },
shipping: { value: '0' },
env: { value: 'sandbox' }, //keep it in the sandbox.
callback: { value: 'http://staging.site.com/confirm/paypalIPN' }
}, { type: 'button' }, parentNode);
});
@patsch
Copy link

patsch commented Oct 21, 2014

Thanks Verikon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment