cancel
Showing results for 
Search instead for 
Did you mean: 

Disable shipping address with react-paypal-js

Options
Go to solution
avi312singh
Contributor
Posted on

Hi I am using this module to integrate the Paypal solution in my site: https://www.npmjs.com/package/@paypal/react-paypal-js

However even though it seems to be developed by paypal, there seems to be no option to disable the shipping address during checkout

 

 

<PayPalScriptProvider options={{ "client-id": clientId, currency: "GBP", "disable-funding": "sofort", shippingPreference: "NO_SHIPPING" }}>

 


Doesn't seem to have any effect at the checkout page as it still shows the delivery address

image.png
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

Disable shipping address with react-paypal-js

Options
Go to solution
avi312singh
Contributor
    const createOrder = (data, actions) => {
        return actions.order
            .create({
                purchase_units: [
                    {
                        amount: {
                            value: donationAmount,
                        },
                    },
                ],
                application_context: {
                    shipping_preference: "NO_SHIPPING"
                }
            })
            .then((orderID) => {
                setOrderID(orderID);
                return orderID;
            });
    }

View solution in original post

1 REPLY 1
Solved

Disable shipping address with react-paypal-js

Options
Go to solution
avi312singh
Contributor
    const createOrder = (data, actions) => {
        return actions.order
            .create({
                purchase_units: [
                    {
                        amount: {
                            value: donationAmount,
                        },
                    },
                ],
                application_context: {
                    shipping_preference: "NO_SHIPPING"
                }
            })
            .then((orderID) => {
                setOrderID(orderID);
                return orderID;
            });
    }

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.