未显示 PayPal SEPA 付款按钮
PayPal SEPA Payment button not showing
我正在使用 PayPal 并想在我当前的网站上添加付款方式 SEPA。
以下是我遵循的一些示例:
- https://developer.paypal.com/docs/checkout/integration-features/standalone-buttons/#funding-sources
- https://demo.paypal.com/de/demo/go_platform/pcRestServerV2/paymentOptions
所以基本上我没有获得 SEPA 按钮,如上面第 2 here 所示 link。
这是我的代码,可以帮助您确定我做错了什么。
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');
}
});
您检查并提供特定资金来源是否有原因?您可以让 PayPal 自动处理,而不是 forEach 循环。基本上,使用更简单的代码; https://developer.paypal.com/demo/checkout/#/pattern/client
如果您不在默认显示 SEPA 的国家/地区,请在沙盒模式下测试时将 &buyer-country=DE
添加到 SDK 脚本查询字符串行。这样做只是为了在沙盒模式下测试其他国家,它不是实时有效的参数。实时会自动检测买家的国家。
我正在使用 PayPal 并想在我当前的网站上添加付款方式 SEPA。 以下是我遵循的一些示例:
- https://developer.paypal.com/docs/checkout/integration-features/standalone-buttons/#funding-sources
- https://demo.paypal.com/de/demo/go_platform/pcRestServerV2/paymentOptions
所以基本上我没有获得 SEPA 按钮,如上面第 2 here 所示 link。
这是我的代码,可以帮助您确定我做错了什么。
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');
}
});
您检查并提供特定资金来源是否有原因?您可以让 PayPal 自动处理,而不是 forEach 循环。基本上,使用更简单的代码; https://developer.paypal.com/demo/checkout/#/pattern/client
如果您不在默认显示 SEPA 的国家/地区,请在沙盒模式下测试时将 &buyer-country=DE
添加到 SDK 脚本查询字符串行。这样做只是为了在沙盒模式下测试其他国家,它不是实时有效的参数。实时会自动检测买家的国家。