cancel
Showing results for 
Search instead for 
Did you mean: 

Implement Checkout without requesting shipping address

Contributor

Implement Checkout without requesting shipping address

Hi, I'm following the instructions laid out on this documentation page for implementing Paypal Checkout:  https://developer.paypal.com/docs/checkout/integrate/

 

We do not want Paypal using the payer's address as the shipping address.  We want Paypal to completely skip anything to do with a shipping address as we collect that ourselves on our website.  We sell gift baskets and the item rarely goes to the purchaser, there is a separate recipient.

 

How do we suppress the collection of the shipping address using this checkout process?

 

I already looked at the Orders API and the application_context option with shipping_preference = NO_SHIPPING but that doesn't work.  It throws a javascript error of "Uncaught ReferenceError: NO_SHIPPING is not defined".

 

javascript code:

 

paypal.Buttons({
// Set up the transaction
createOrder: function(data, actions){
return actions.order.create({
purchase_units: [{
amount: {
value: '#numberformat(OrderTotal + ShippingTotal + TaxTotal, "9.99")#'
}
}],
application_context: {
shipping_preference: NO_SHIPPING
}
});
}
}).render('#paypal-button-container');