亚马逊支付集成小部件

时间:2019-10-24 05:40:47

标签: coldfusion-11 amazon-pay

在没有地址引用文档的情况下实施亚马逊薪酬小工具 https://developer.amazon.com/docs/eu/amazon-pay-onetime/no-address-widget.html

用来自卖方中心的已注册应用程序值替换了客户ID和卖方ID,但显示错误消息“您不能使用与卖方帐户关联的用户名和密码。请使用其他买方帐户。”

这是使用的代码

<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>

2 个答案:

答案 0 :(得分:0)

您使用相同的电子邮件地址以用户身份登录到沙盒环境,而不是使用 customer 身份登录到卖家中央帐户。

>

出于测试目的,您可以在卖方中央帐户中创建一个新的沙箱买方帐户。

This documentation应该可以帮助您实现目标。还有一个视频逐步显示了该过程。

答案 1 :(得分:0)

通过将clientid js放在读取位置的前面来解决错误消息 https://developer.amazon.com/docs/amazon-pay-onetime/add-widgets.html

但是,现在没有显示,只有空白屏幕。