Paypal Smart Button Customisation - No Shipping & Locale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm adding some paypal smart buttons to our site, to take 1 off payments with variable prices.
These are for digital goods & therefore don't require shipping, they will be from the UK 99% of the time and so i'd like to specify UK as the default country.
Is there anyway to customise the "Debit or Credit Card" form which is used as part of the smart button setup
There is a similar issue when using the paypal guest checkout via the paypal button:
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: {
currency_code: 'GBP',
value: '0.50'
},
description: description,
reference_id: 'XXX',
locale: 'en_GB',
address_name: {country_code: 'en_GB'},
shipping_type: 'PICKUP',
application_context: {shipping_preference: 'NO_SHIPPING'},
order_application_context: {brand_name: 'XXX'},
order_confirm_application_context: {brand_name: 'XXX'}
}]
});
},
I've tried the options above, which i found in the documentation to attempt to set the locale to en_GB and NO_SHIPPING but they have had no effect.
Any assistance would be much appreciated
Thanks
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this: Remove my JQuery
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'
}
});
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply @JackieDaytona ,
I think you mean this bit:
application_context: {
shipping_preference: 'NO_SHIPPING'
}
Its already in my code though? Am i missing something?
Thanks again for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is the whole format:
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'
}
});
},
This def does work because I am using it. Also just remove my JQuery stuff.
Hope that helps
D
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- API - Change currency when shipping country changes in SDKs
- Sandbox works but live => INVALID_RESOURCE_ID in Sandbox Environment
- PAYER_ACTION_REQUIRED when creating order using REST API in REST APIs
- Transaction detail always shows "Not specified" for customer phone number. in PayPal Payments Standard
- Update fields | Billing Page | JSON in REST APIs