【发布时间】:2014-12-12 13:16:45
【问题描述】:
我正在尝试将 Amazon Payments(仅限付款,不使用 Amazon 登录)集成到我的网站中。
我可以成功显示支付的验证表单:
<div id="AmazonPayButton" />
@{
var callbackurl = string.Format("{0}://{1}/Account/AmazonConfirm", Request.Url.Scheme, Request.Url.Authority);
}
<script type="text/javascript">
OffAmazonPayments.Button("AmazonPayButton", "M_MYSELLERID_1234567", {
type: "PwA",
size: "medium",
authorization: function() {
loginOptions =
{scope: "payments:widget", popup: true };
authRequest = amazon.Login.authorize(loginOptions, "@(callbackurl)");
},
onError: function(error) {
alert('We could not connect to Amazon to process your payment, try again later');
}
});
</script>
</div>
亚马逊在身份验证后成功重定向到我的回调 URL。但是,当我尝试使用 Same Seller ID 显示钱包小部件时,我收到“无效的卖家 ID”错误:
<div id="walletWidgetDiv">
</div>
<script>
new OffAmazonPayments.Widgets.Wallet({
sellerId: 'M_MYSELLERID_1234567',
onReady: function(billingAgreement) {
var billingAgreementId = billingAgreement.getAmazonBillingAgreementId();
},
agreementType: 'BillingAgreement',
design: {
size : {width:'400px', height:'260px'}
},
onPaymentSelect: function(billingAgreement) {
// Replace this code with the action that you want to perform
// after the payment method is selected.
},
onError: function(error) {
alert(error.getErrorMessage());
}
}).bind("walletWidgetDiv");
</script>
为什么验证会起作用,但钱包显示会被拒绝?
更新 @Brent Douglas 在他的回答中触发我重新检查我的卖家 ID,并且我在我的一个脚本引用中指定了一个不正确的 ID。现在我收到以下错误:
“卖家ID未处于执行请求的适当状态”
不知道这意味着什么。我检查了我的帐户并指定了存款/银行信息,集成设置页面上没有标记任何其他内容。帐户中是否还有其他需要添加/验证的内容? (除了典型的,网页URL和其他信息)
【问题讨论】:
-
查看this,在钱包选项卡上...您在哪里定义了顶部?
-
也...starting on page 19 这比我在网上找到的任何其他地方都更详细。有时错误并不完全准确,也可能是其他一些信息丢失。
-
你在沙箱里吗?
-
@gloomy.penguin 我确实定义了那部分,只是把它省略了,将重新检查您链接的文档
-
@Abkarino 是的,在沙盒模式下
标签: javascript amazon-pay