在没有地址引用文档的情况下实施亚马逊支付小部件 https://developer.amazon.com/docs/eu/amazon-pay-onetime/no-address-widget.html
将clientid和sellerid替换为卖家中心注册的应用程序值,但出现错误“您不能使用与您的卖家账户关联的用户名和密码。请使用其他买家账户。”
这是使用的代码
<script type='text/javascript'
src='https://static-na.payments-amazon.com/OffAmazonPayments/us/sandbox/js/Widgets.js'>
<script>
window.onAmazonLoginReady = function() {
amazon.Login.setClientId('yyyyyyyyy');
};
</script>
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0"/>
<!-- Place this code in your HTML where you want the -->
<div id="walletWidgetDiv">
</div>
<script>
var orderReferenceId = null;
new OffAmazonPayments.Widgets.Wallet({
sellerId: 'xxxx',
// Add the onOrderReferenceCreate function to
// generate an Order Reference ID.
onOrderReferenceCreate: function(orderReference) {
// Use the following cod to get the generated Order Reference ID.
orderReferenceId = orderReference.getAmazonOrderReferenceId();
},
design: {
designMode: 'responsive'
},
onPaymentSelect: function(orderReference) {
// Replace this code with the action that you want to perform
// after the payment method is selected.
// Ideally this would enable the next action for the buyer
// such as a "Continue" or "Place Order" button.
},
onError: function(error) {
// Your error handling code.
// During development you can use the following
// code to view error messages:
// console.log(error.getErrorCode() + ': ' + error.getErrorMessage());
// See "Handling Errors" for more information.
}
}).bind("walletWidgetDiv");
</script>