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
274 stars 81 forks source link

[BUG] #101

Closed LuizGMX closed 3 years ago

LuizGMX commented 3 years ago

Payment with credit card not working, only with paypal credits.


 <PayPalButton
                amount="0.01"
                currency="BRL"
                // shippingPreference="NO_SHIPPING" // default is "GET_FROM_FILE"
                onSuccess={(details, data) => {
                    alert("Transaction completed by " + details.payer.name.given_name);

                    // OPTIONAL: Call your server to save the transaction
                    return fetch("/paypal-transaction-complete", {
                        method: "post",
                        body: JSON.stringify({
                            orderId: data.orderID
                        })
                    });
                }}
                options={{
                    clientId: "OMMITED",
                    currency: 'BRL'
                }}
            />