Skip to content

Instantly share code, notes, and snippets.

@Lkubok
Created June 15, 2020 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lkubok/c85976054c41fad9adbbb89609d6c240 to your computer and use it in GitHub Desktop.
Save Lkubok/c85976054c41fad9adbbb89609d6c240 to your computer and use it in GitHub Desktop.
amazon3
<!--- 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