我正在使用PayPal,并且想在我当前的网站上添加付款方式SEPA。 这是我遵循的一些示例:
所以基本上我没有在第二个链接上方显示here上的SEPA按钮。
这是我的代码,可帮助您确定我在做什么错。
var FUNDING_SOURCES = [
paypal.FUNDING.PAYPAL,
paypal.FUNDING.VENMO,
paypal.FUNDING.CREDIT,
paypal.FUNDING.CARD,
paypal.FUNDING.SEPA,
];
FUNDING_SOURCES.forEach(function(fundingSource) {
// Initialize the buttons
var button = paypal.Buttons({
fundingSource: fundingSource
});
// Check if the button is eligible
if (button.isEligible()) {
// Render the standalone button for that funding source
button.render('#paypalCheckoutContainer');
}
});
答案 0 :(得分:1)
您是否有理由检查并提供特定的资金来源?您可以让PayPal自动处理该问题,而不是forEach循环。基本上,在以下位置使用更简单的代码; https://developer.paypal.com/demo/checkout/#/pattern/client
如果您不在默认显示SEPA的国家/地区,则在沙盒模式下进行测试时,请在SDK脚本查询字符串行中添加&buyer-country=DE
。仅在沙盒模式下测试其他国家/地区时才这样做,它不是实时有效的参数。买家所在的国家/地区将被实时自动检测。