Sometimes the paypal pay button is not shown to our customers. So far just DE customers. I am using Javascript SDK. It looks like because the button.isEligible() function is not true and executed. What can I do to show the button or show a payment alternative?
Currently the customer can decide with radio buttons which payment method he wants. Then he is directed to: Paypal, SEPA or credit card.
<script>
// Loop over each funding source/payment method
var FUNDING_SOURCES = [
paypal.FUNDING.<?php echo strtoupper($paymentmethod); ?>
];
FUNDING_SOURCES.forEach(function(fundingSource) {
// Initialize the buttons
var button = paypal.Buttons({
fundingSource: fundingSource,
createOrder: function (data, actions) {
...
onApprove: function (data, actions) {
return actions.order.capture().then(function (orderData) {
...
// Check if the button is eligible
if (button.isEligible()) {
// Render the standalone button for that funding source
button.render('#paypal-button-container');
}
});
As I am showing just one button I probably have to use "button.isEligible()", correct? As this is working for most customers can it be it depends on the customer?
Can I add an else statement like:
if (button.isEligible()) {
button.render('#paypal-button-container');
} else {
"please try again later or use a different payment method"
}