PayPal Checkout Turn Off Shipping

dloughry
Contributor
Contributor

Hi,

I don't am trying to setup an online purchase that does not require shipping. I have added the following code to my website:

 

<script
src="https://www.paypal.com/sdk/js?client-id=sb&locale=en_AU&currency=AUD">
</script>

<script>
paypal.Buttons({
createOrder: function(data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
return actions.order.create({
purchase_units: [{
amount: {
value: '0.01'
},
application_context: {
shipping_preference: "NO_SHIPPING",
}
}]
});
},
onApprove: function(data, actions) {
// This function captures the funds from the transaction.
return actions.order.capture().then(function(details) {
// This function shows a transaction success message to your buyer.
alert('Transaction completed by ' + details.payer.name.given_name);
});
}
}).render('#paypal-button-container');
</script>

 

When I click the Debit or Credit Card button that displays, it requests a billing address and has a check box called "Ship to billing address". Is there a way to turn this off?

 

Thanks

Login to Me Too
2 REPLIES 2

JackieDaytona
Contributor
Contributor

I think you missed the description.  I think Shipping looks at it.

 

Here is code that does work

 

       return actions.order.create({
          purchase_units: [{
                description: 'GnG Order',
                amount: {
                   value: cartTotal
            }
       }],
        application_context: {
       shipping_preference: 'NO_SHIPPING'
      }
    });
     },

End of Code Block

Login to Me Too

JackieDaytona
Contributor
Contributor

CartTotal is a variable in my system so sub accordingly 

Login to Me Too

Haven't Found your Answer?

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