Skip to main content

Step3 Add javascript to render Amazon SignIn button on your site

Finally add javascript to render Amazon SignIn button on your site like below.

<body>
<div id="AmazonSignInButton"></div>
<script src="https://static-fe.payments-amazon.com/checkout.js"></script>
<script type="text/javascript" charset="utf-8">
amazon.Pay.renderButton('#AmazonSignInButton',
//put fundamental parts that you created in Step2 here
);
</script>
</body>

Javascript sample (including fundamental parts in javascript) as below.

<body>
<div id="AmazonSignInButton"></div>
<script src="https://static-fe.payments-amazon.com/checkout.js"></script>
<script type="text/javascript" charset="utf-8">
amazon.Pay.renderButton('#AmazonSignInButton',{
"merchantId": "xxxxxx",
"ledgerCurrency": "JPY",
"sandbox": true,
"checkoutLanguage": "ja_JP",
"productType": "SignIn",
"placement": "Home",
"buttonColor": "Gold",
"signInConfig": {
"payloadJSON": {
"signInReturnUrl": "http://localhost:3000/getBuyer/",
"storeId": "amzn1.application-oa2-client.ccxxxxxx",
"signInScopes": ["name","email","postalCode","shippingAddress","billingAddress","phoneNumber"]
},
"signature": "xxxxxx",
"publicKeyId": "SANDBOX-xxxxxx"
}
});
</script>
</body>
caution

Make sure to show button in appropriate size. See FAQ - I want to know how to configure Amazon Pay button