Search code examples
phppaypalpaypal-sandbox

PayPal SEPA Payment button not showing


I'm using PayPal and want to add the payment method SEPA on my current website. Here are some examples I have followed:

  1. https://developer.paypal.com/docs/checkout/integration-features/standalone-buttons/#funding-sources
  2. https://demo.paypal.com/de/demo/go_platform/pcRestServerV2/paymentOptions

So basically I'm not getting SEPA button as displayed here on above 2nd link.

Here is my code that helps you to identify what I'm doing wrong.

    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');
    }
});

Solution

  • Is there a reason you are checking for and rendering particular funding sources? You can let PayPal handle that automatically instead of a forEach loop. Basically, use the simpler code at; https://developer.paypal.com/demo/checkout/#/pattern/client

    If you are not located in a country that defaults to showing SEPA, add &buyer-country=DE to the SDK script query string line when testing in sandbox mode. Only do this for testing other countries in sandbox mode, it is not a valid parameter in live. The buyer's country will be auto detected in live.