Home > Mobile >  Disable certain payment with react-paypal-button-v2 not working
Disable certain payment with react-paypal-button-v2 not working

Time:10-17

react-paypal-button-v2 works fine for me but when it comes to disable a certain payment it's not working properly. If I don't use the props "disableFunding" I get this payments: PayPal, Sofort, GiroPay, and Credit Card. When I give the props "disableFunding" the value it shows me in 90% of cases only PayPal as payment and nothing else. Sometimes it works properly and shows PayPal, Sofort, GiroPay but it's really seldom when I use disableFunding: 'card'.

Is there any way how I can disable Credit Card but keeping the other payments beside PayPal?

<PayPalButton
    options={{
    clientId: 'sb',
    //disableFunding: 'card',
    }}
    amount={100}
/>

CodePudding user response:

If you are changing the parameter repeatedly between page loads, caching local to the browser will temporarily cause other buttons to not render. It should work fine if you leave the disableFunding parameter set to what you're going to be using and stop messing with it for testing purposes.

react-paypal-button-v2 is not an official package, consider changing to @paypal/react-paypal-js ...storybook examples

  • Related