我正在使用 Pay With Amazon Express Integration 。因为我必须创建自定义 Pay With Amazon
按钮,如所述 here :
一切都很顺利,但是当我单击使用亚马逊付款
按钮时,它会在同一页面中打开窗口。我希望该窗口在弹出窗口
中打开。
有什么方法可以让Pay With Amazon
按钮在popup
中打开window
。
这是我的代码:
<script type="text/javascript">
OffAmazonPayments.Button("AmazonPayButton", app.conf.amazonPaySellerId, {
type: "hostedPayment",
hostedParametersProvider: function(done) {
$.getJSON(app.conf.siteUrl + 'generatePaymentRequestSignature', {
amount: $("#depositAmount").val() ? $("#depositAmount").val() : 10,
currencyCode: 'USD',
sellerNote: "Deposit to App",
returnURL : window.location.href,
sellerOrderId : localStorage.getItem("UserAccessToken")
},
function(data) {
if(data.status && data.code == 200) {
done(JSON.parse(data.data));
} else {
alert("Service is not available. Please try again later");
}
})
},
onError: function(errorCode) {
console.log(errorCode.getErrorCode() + " " + errorCode.getErrorMessage());
}
});
</script>
我想在弹出窗口中打开它,因为我的应用程序将被其他网站使用 iframe
嵌入。当我们点击Pay
按钮时,它会在同一窗口中打开,但该窗口不起作用。
注意:有一个选项可用于在弹出窗口中打开窗口,对于使用按钮生成器实用程序生成的按钮,如所述 here ,但不知道如何使用 hostedPayment
类型来完成。
感谢您的宝贵时间。
最佳答案
目前没有办法做到这一点,因为它是托管解决方案。您引用的示例不使用按钮生成器,它使用标准登录与亚马逊集成。使用按钮生成器生成的按钮被视为 Express 集成。
获得弹出体验的唯一方法是进行自定义 LPA 集成,但“支付”按钮在 iframe 中不起作用。
关于javascript - 使用亚马逊付款 在弹出窗口中打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31565789/