[Skip to main content](#vessel-content)

#   Adaptations Paypal Checkout REST API plugin

##

- **[tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile")**
- [![tgdkere2's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8136-tgdkere2 "View tgdkere2's Profile") Topic Author
- [ Offline](/forum/user/8136-tgdkere2)

Less More

- Posts: 82
- Thank you received: 5
-
-

3 years 4 months ago -  3 years 4 months ago [\#352782](#352782) by [tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile")  *[Adaptations Paypal Checkout REST API plugin](/forum/29-payment-methods/906614-adaptations-paypal-checkout-rest-api-plugin#352782 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.2  Hi,  Often, the customer does not provide a shipping address. However, the Country for the shipping address is always set, even if the customer does not specify a shipping address. This leads to problems with paypal, because they get the country code and expect also a ZIP code and CITY then. Otherwise the payment fails.  Can you please adapt the paypal plugin to check all fields for the shipping address and add an else part with &quot;NO&#95;SHIPPING&quot; ?.  in paypalcheckout.php:  Instead of:              if(!empty($order-&gt;cart-&gt;shipping&#95;address)) {  please change to:              if(!empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;firstname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;lastname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;street) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;city) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;post&#95;code) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;country-&gt;zone&#95;code&#95;2)) {  If no shipping address is specified, it would also make sense to add the NO&#95;SHIPPING parameter in the application&#95;context. Like this (if is same as above and then add else part):  if(!empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;firstname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;lastname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;street) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;city) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;post&#95;code) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;country-&gt;zone&#95;code&#95;2)) { .... .... .... ... ...  else {    $orderData-&gt;application&#95;context-&gt;shipping&#95;preference = 'NO&#95;SHIPPING'; }  Thank you and best regards")* was created by *[tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile")*

-- HikaShop version -- : 4.7.4
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4.2

Hi,

Often, the customer does not provide a shipping address. However, the Country for the shipping address is always set, even if the customer does not specify a shipping address. This leads to problems with paypal, because they get the country code and expect also a ZIP code and CITY then. Otherwise the payment fails.

Can you please adapt the paypal plugin to check all fields for the shipping address and add an else part with "NO_SHIPPING" ?.

in paypalcheckout.php:

Instead of:
if(!empty($order-&gt;cart-&gt;shipping_address)) {

please change to:
if(!empty($order-&gt;cart-&gt;shipping_address-&gt;address_firstname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping_address-&gt;address_lastname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping_address-&gt;address_street) &amp;&amp; !empty($order-&gt;cart-&gt;shipping_address-&gt;address_city) &amp;&amp; !empty($order-&gt;cart-&gt;shipping_address-&gt;address_post_code) &amp;&amp; !empty($order-&gt;cart-&gt;shipping_address-&gt;address_country-&gt;zone_code_2)) {

If no shipping address is specified, it would also make sense to add the NO_SHIPPING parameter in the application_context.
Like this (if is same as above and then add else part):

if(!empty($order-&gt;cart-&gt;shipping_address-&gt;address_firstname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping_address-&gt;address_lastname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping_address-&gt;address_street) &amp;&amp; !empty($order-&gt;cart-&gt;shipping_address-&gt;address_city) &amp;&amp; !empty($order-&gt;cart-&gt;shipping_address-&gt;address_post_code) &amp;&amp; !empty($order-&gt;cart-&gt;shipping_address-&gt;address_country-&gt;zone_code_2)) {
....
....
....
...
...

else {
$orderData-&gt;application_context-&gt;shipping_preference = 'NO_SHIPPING';
}

Thank you and best regards

Last edit: 3 years 4 months ago by [tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile").

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3BheW1lbnQtbWV0aG9kcy85MDY2MTQtYWRhcHRhdGlvbnMtcGF5cGFsLWNoZWNrb3V0LXJlc3QtYXBpLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86363
- Thank you received: 14296
-
-

3 years 4 months ago [\#352786](#352786) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Adaptations Paypal Checkout REST API plugin](/forum/29-payment-methods/906614-adaptations-paypal-checkout-rest-api-plugin#352786 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.2  Hi,  Often, the customer does not provide a shipping address. However, the Country for the shipping address is always set, even if the customer does not specify a shipping address. This leads to problems with paypal, because they get the country code and expect also a ZIP code and CITY then. Otherwise the payment fails.  Can you please adapt the paypal plugin to check all fields for the shipping address and add an else part with &quot;NO&#95;SHIPPING&quot; ?.  in paypalcheckout.php:  Instead of:              if(!empty($order-&gt;cart-&gt;shipping&#95;address)) {  please change to:              if(!empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;firstname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;lastname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;street) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;city) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;post&#95;code) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;country-&gt;zone&#95;code&#95;2)) {  If no shipping address is specified, it would also make sense to add the NO&#95;SHIPPING parameter in the application&#95;context. Like this (if is same as above and then add else part):  if(!empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;firstname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;lastname) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;street) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;city) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;post&#95;code) &amp;&amp; !empty($order-&gt;cart-&gt;shipping&#95;address-&gt;address&#95;country-&gt;zone&#95;code&#95;2)) { .... .... .... ... ...  else {    $orderData-&gt;application&#95;context-&gt;shipping&#95;preference = 'NO&#95;SHIPPING'; }  Thank you and best regards")*

Hi,

Thank you for your feedback. We'll add these changes for the next version of HikaShop.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3BheW1lbnQtbWV0aG9kcy85MDY2MTQtYWRhcHRhdGlvbnMtcGF5cGFsLWNoZWNrb3V0LXJlc3QtYXBpLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.049 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
