Orders API for digital goods to not display "ship to billing address" or NO_SHIPPING option

diyss
Contributor
Contributor

We sell digital goods (as a service) on our site, and we are using the PayPal smart buttons (which utilizes the Orders API).

 

When going through the checkout process, and the buyer selects "Debit or Credit Card", it has a checkbox of "Ship to Billing Address". Since we are selling digital goods, we do not want a billing address to be required by our customers.

 

I have looked into setting the "application_context" or "order_application_context" attributes, setting the "shipping_preference" to NO_SHIPPING. However, this does not seem to affect anything in the sandbox or live version. Any guidance is appreciated!

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

JackieDaytona
Contributor
Contributor

Here ya go, hope this helps

 

Mind you I use JQuery so fix accordingly:

 


        // Render the PayPal button into #paypal-button-container
       // by David . Nugent - Using PayPal REST V2 API Last update: 05/27/2020
      paypal.Buttons({

                     style: {
                          layout: 'horizontal',
                           color: 'gold',
                           shape: 'pill',
                           label: 'checkout',
                           size: 'responsive',
                           tagline: 'true',

                     },
                    // Set up the transaction
                     createOrder: function(data, actions) {
                     $('#paypalmsg').hide();
                      $('#transmsg').show();
                      $('#transmsg').html('<b>'+'WAITING ON AUTHORIZATION...'+'</b>');
                       $('#chkoutmsg').hide()
                       return actions.order.create({
                              purchase_units: [{
                                   description: 'GnG Order',
                                   amount: {
                                       value: cartTotal
                               }
                         }],
                          application_context: {
                          shipping_preference: 'NO_SHIPPING'
                       }
                });
             },
 

View solution in original post

Login to Me Too
2 REPLIES 2
Solved

JackieDaytona
Contributor
Contributor

Here ya go, hope this helps

 

Mind you I use JQuery so fix accordingly:

 


        // Render the PayPal button into #paypal-button-container
       // by David . Nugent - Using PayPal REST V2 API Last update: 05/27/2020
      paypal.Buttons({

                     style: {
                          layout: 'horizontal',
                           color: 'gold',
                           shape: 'pill',
                           label: 'checkout',
                           size: 'responsive',
                           tagline: 'true',

                     },
                    // Set up the transaction
                     createOrder: function(data, actions) {
                     $('#paypalmsg').hide();
                      $('#transmsg').show();
                      $('#transmsg').html('<b>'+'WAITING ON AUTHORIZATION...'+'</b>');
                       $('#chkoutmsg').hide()
                       return actions.order.create({
                              purchase_units: [{
                                   description: 'GnG Order',
                                   amount: {
                                       value: cartTotal
                               }
                         }],
                          application_context: {
                          shipping_preference: 'NO_SHIPPING'
                       }
                });
             },
 

Login to Me Too

diyss
Contributor
Contributor

It turns out I had the application_context in the wrong position object. Thanks for your response!

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.