PayPal Express Checkout: remove shipping option

RdM2016
New Community Member

Heya everyone.

I'm experiencing a problem with paypal express checkout.

I'm implementing the paypal express checkout in my website page and i started from the demo that i fond here:  (https://demo.paypal.com/us/demo/home).

 

The problem is that i'd like to use paypal only for the payment: i dont need and i dont want my customers to choose a shipping address but i cant find a way to remove the option.

 

Can anyone help me? Many Thanks 🙂

Login to Me Too
4 REPLIES 4

MTS_Ciaran
Moderator
Moderator

Hi,

 

you can suppress the shipping address using the noshipping parameter  see here for more details:

 

https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECCustomizing/#suppress...

Login to Me Too

chinjh
Contributor
Contributor

Hi, my product is digital type so there is no shipping option needed. I'm using the latest PayPal Express Checkout Integration Client Side REST:

https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/ which doesnt provide method to hide the address. The above mentioned already deprecated. Please Help.

Login to Me Too

Gaurav_IR
Contributor
Contributor

Hi,

 

I have integrated Express Checkout with Shopify. I do not know how to customize the code.

Can you please direct me the setting/link (or URL) where I can see the API calls and customize them?

Login to Me Too

JackieDaytona
Contributor
Contributor

Since Shopify is in Ruby...JavaScript should be OK.  There are good articles on Rails and JQuery integragtion, like JQuery Rails over on Github..

so here is my code for an express checkout

 

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'
}

});
},
/* onClick: function() { */

/* },*/

// Finalize the transaction
onApprove: function(data, actions) {
return actions.order.get().then(function(orderDetails) {
// Show a success message to the buyer
$('#transmsg').html('<b>' + 'AUTHORIZED...' + '</b>');
$('#transmsg').append('<br>'+'Transaction completed by: ' + orderDetails.payer.name.given_name +' '+ orderDetails.payer.name.surname + '<br>' + "Order Id: " + orderDetails.id + '<br>' + 'Status: ' + orderDetails.status+'!' + '<br>'+ 'Thank You For Your Order'+ '<br>');
if (orderDetails.status === "APPROVED") {
window.setTimeout(function() {}, 500)
$('#transmsg').append('<b>' + 'Sending Order...Please Wait' + '</b>'+'<br>');
var getId = '#'+ $('span:contains("Market")').attr('id');
var getmrktDiv = '#'+ $(getId).offsetParent().attr('id');
var mrktchkId = '#'+ $(getmrktDiv).closest(getmrktDiv).find(".chkbox").attr('id');
var mrktpriceId = '#'+ $(getmrktDiv).closest(getmrktDiv).find(".price").attr('id');
var chkboxId = "#chk6";
var hidpriceId = "#pricef";
var marketLocation = $(mrktchkId);

if (marketLocation.length > 0 ) {
var checked = $(mrktchkId).prop('checked');
if (!checked) {
var storedVal = $(mrktpriceId).val();
if ($(mrktpriceId+':not([data-val])')) {
$(mrktpriceId).attr("data-val", storedVal);
}
$(mrktpriceId).val("");
}
}

$('#transid').val(orderDetails.id);
$('#orderstat').val(orderDetails.status);
$('#orderform').submit();
}
});

if (details.error === 'INSTRUMENT_DECLINED') {
$('#transmsg').html('<b>' + 'TRANSACTION WAS DECLINED'+'</b>');
$('#transmsg').fadeIn('slow').delay(3000).fadeOut('slow', function() {
$('#paypalmsg').show();
$('#chkoutmsg').show();
$('#transmsg').empty();
});

return actions.restart();
};
},

onCancel: function(data) {
$('#transmsg').html('<b>' + 'YOUR TRANSACTION WAS CANCELLED' + '</b>');
$('#transmsg').fadeIn('slow').delay(3000).fadeOut('slow', function() {
$('#paypalmsg').show();
$('#chkoutmsg').show();
$('#transmsg').empty();
});
}

}).render('#paypal-button-container');

 

 

Hope this helps ya

 

D

 

 

 

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.