Skip to content

Instantly share code, notes, and snippets.

@Lkubok
Created June 15, 2020 17:11
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/62ffb6af65c31abafadb375ac312a7d2 to your computer and use it in GitHub Desktop.
Save Lkubok/62ffb6af65c31abafadb375ac312a7d2 to your computer and use it in GitHub Desktop.
amazon2
<!--- please put the style below inside your CSS file -->
<style type="text/css">
#addressBookWidgetDiv{width: 400px; height: 228px;}
</style>
<div id="addressBookWidgetDiv">
</div>
<script>
new OffAmazonPayments.Widgets.AddressBook({
sellerId: 'YOUR_SELLER_ID_HERE',
agreementType: 'BillingAgreement',
onReady: function(billingAgreement) {
var billingAgreementId = billingAgreement.
getAmazonBillingAgreementId();
},
onAddressSelect: function(billingAgreement) {
// Replace the following code with the action that you want to perform
// after the address is selected.
// The amazonBillingAgreementId can be used to retrieve
// the address details by calling the GetBillingAgreementDetails operation.
// If rendering the AddressBook and Wallet widgets on the same page, you
// should wait for this event before you render the Wallet widget for
// the first time.
// The Wallet widget re-renders itself on all subsequent
// onAddressSelect events without any action from you. We don't
// recommend that you explicitly refresh it.
},
design: {
designMode: 'responsive'
},
onError: function(error) {
// your error handling code
}
}).bind("addressBookWidgetDiv");
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment