Luehang / react-paypal-button-v2

An easy and simple to use React button component to implement PayPal Checkout with Smart Payment Buttons V2 (Version 2).
https://luehangs.site/lue_hang/projects/react-paypal-button-v2
MIT License
273 stars 81 forks source link

[BUG] 'p24' value for disableFunding option produces a 400 response #37

Open KZafeiropoulosN opened 4 years ago

KZafeiropoulosN commented 4 years ago

To Do First

Software Package Version: react-paypal-button-v2: 2.4.1 Describe the bug

I am trying to disable the Przelewy24 funding source which can be disabled by giving the value p24 in disableFunding option. This value is obtained by the official documentation. When I try to load the buttons using this value, unfortunately the PayPalButton component doesn't load at all producing a 400 error on the request. I am attaching a snapshot below.

Note 1.

Other options are working as expected. For example if I use card value as an option the paypal default button is rendered and the cards are not rendered.

Note 2.

I am basically trying to disable all funding sources as I only want to show the default paypal button for now. If there is an option to disable all funding sources it would work for me. To Reproduce Steps to reproduce the behavior:

  1. Try to load PayPalButton with the options prop seen bellow
    options={{clientId: configLocal.PAYPAL_SANDBOX_CLIENT_ID,
              buyerCountry: 'PL',
              disableFunding: 'p24'}}

    I am using buyerCountry: 'PL' as Poland is the country where Przelewy24 funding source is shown.

Expected behavior Loading PayPal default button

Screenshots p24-error

Desktop (please complete the following information):

SirSerje commented 4 years ago

@KZafeiropoulosN I've reproduced your issue https://github.com/Luehang/react-paypal-button-v2/issues/46 and there is possible fix (look at PRs)