Disabling shipping address in payment flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello! I'm implementing a payment flow using the REST api and the checkout buttons. I'm selling digital products, so shipping information is at best unnecessary, and at worst confusing. I'd like to disable the option to provide shipping. Here's the code I'm using:
{
intent,
application_context: {
shipping_preference: 'NO_SHIPPING'
},
purchase_units: [{
amount: {
currency_code: 'USD',
value: '10',
breakdown: {
item_total: {
value: '10',
currency_code: 'USD'
}
}
},
description: 'Hello world',
soft_descriptor: 'Hello world',
items: [{
name: 'Hello world',
unit_amount: {
value: '10',
currency_code: 'USD'
},
quantity: 1
}]
}]
}
As you can see, i'm setting my shipping_preference to NO_SHIPPING, but as you can also see from the attached image, it's still prompting a shipping address. what am i doing wrong? what can i do to hide the shipping info?
Thanks!
Jack
- Labels:
-
Payments REST APIs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Shipping options are not appearing in my cart through link or button. in PayPal Payments Standard
- Show all billing address fields when hiding shipping address fields in PayPal Payments Standard
- Paypal 4X credit : translated message & currency error in PayPal Payments Standard
- Hide shipping address in Debit/Credit card form in PayPal Payments Standard
- PayPal Buttons in PayPal Payments Standard