Created
June 15, 2020 17:12
-
-
Save Lkubok/c85976054c41fad9adbbb89609d6c240 to your computer and use it in GitHub Desktop.
amazon3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- put the style below inside your CSS file --> | |
<style type="text/css"> | |
#consentWidgetDiv {width: 400px; height: 140px;} | |
</style> | |
<div id="consentWidgetDiv"> | |
</div> | |
<script> | |
new OffAmazonPayments.Widgets.Consent({ | |
sellerId: 'YOUR_SELLER_ID_HERE', | |
// amazonBillingAgreementId obtained from the Amazon Address Book widget. | |
amazonBillingAgreementId: amazonBillingAgreementId, | |
design: { | |
designMode: 'responsive' | |
}, | |
onReady: function(billingAgreementConsentStatus){ | |
// Called after widget renders | |
buyerBillingAgreementConsentStatus = | |
billingAgreementConsentStatus.getConsentStatus(); | |
// getConsentStatus returns true or false | |
// true - checkbox is selected | |
// false - checkbox is unselected - default | |
}, | |
onConsent: function(billingAgreementConsentStatus) { | |
buyerBillingAgreementConsentStatus = | |
billingAgreementConsentStatus.getConsentStatus(); | |
// getConsentStatus returns true or false | |
// true - checkbox is selected - buyer has consented | |
// false - checkbox is unselected - buyer has not consented | |
// Replace this code with the action that you want to perform | |
// after the consent checkbox is selected/unselected. | |
}, | |
onError: function(error) { | |
// your error handling code | |
} | |
}).bind("consentWidgetDiv "); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment