Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add Login and Pay callbacks
- window.onAmazonPaymentsReady = () => {
- this.createButton(sellerId, scope, type, color, size, mountLocation);
- }
- // if the OffAmazonPayments namespace is already available, call the callback manually - otherwise wait for Amazon to call it
- if (typeof window.OffAmazonPayments !== 'undefined') {
- window.onAmazonPaymentsReady();
- }
- createButton(sellerId, scope, type, color, size, mountLocation) {
- window.OffAmazonPayments.Button(mountLocation, sellerId, {
- type,
- color,
- size,
- authorization: () => {
- const loginOptions = { scope };
- window.amazon.Login.authorize(loginOptions, this.onAuthorize);
- },
- onError: this.onError,
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement