You have no items in your shopping cart.

Sunday, November 24, 2024 12:33:36 PM

Bug with State / Province (County in the UK)

Posted: 6 years ago

#6934 Quote
Hi,

Just a quick query regarding the PayPal Express plugin for nopCommerce (in this instance, 3.90).

The plugin works fine, although I've noticed that the State / Province (County in the UK) isn't being added to either the billing, or shipping address? Obviously for shipping, this is an issue.

Any ideas?

Posted: 6 years ago

#6935 Quote

Support

Posted: 6 years ago

#6935 Quote
Plugin uses NopCommerce StateProvince.Abbreviation.
Open your store in admin mode and check Abbreviations for States/Provinces.
Read this documentation
https://developer.paypal.com/docs/classic/api/state_codes/
And compare them.
But I didn't see spate/province code for UK. Ask PayPal support about them.

Our code
                        state = customer.ShippingAddress.StateProvince != null ? customer.ShippingAddress.StateProvince.Abbreviation : null,


Posted: 6 years ago

#6947 Quote
Hi again,

This is the reply from PayPal...


Please provide an example of the SetExpressCheckout request that your submitting. The reason the UK isn't listed on the page you referenced, is that for those countries it is required to pass values for the "PAYMENTREQUEST_n_SHIPTOSTATE" field, but for other countries which are not listed it is not a requirement.
If your passing this variable and a value in your SetExpressCheckout API request, it should be passed and recorded for that transaction and stored in the token which is returned as a result of the SetExpressCheckout API request.

Posted: 6 years ago

#6948 Quote

Support

Posted: 6 years ago

#6948 Quote
Answer it.

Plugin uses REST API and uses original PayPal.dll 1.8.0.0.

We try to send
object PayPal.Api.ItemList.shipping_address
Our code


                var itemList = new ItemList()
                {
                    items = items,

                    #region shipping address

                    shipping_address = customer.ShippingAddress == null ? null : new ShippingAddress
                    {
                        country_code = GetCountryTwoLetterIsoCode(customer.ShippingAddress),
                        state = customer.ShippingAddress.StateProvince != null ? customer.ShippingAddress.StateProvince.Abbreviation : null,
                        city = customer.ShippingAddress.City,
                        line1 = PreparePayPalValue(customer.ShippingAddress.Address1,100),
                        line2 = PreparePayPalValue(customer.ShippingAddress.Address2, 100),
                        phone = PreparePhoneNumber(customer.ShippingAddress.PhoneNumber),
                        postal_code = (customer.ShippingAddress.ZipPostalCode??"").Trim(),
                        recipient_name = string.Format("{0} {1}", customer.ShippingAddress.FirstName, customer.ShippingAddress.LastName)
                    }

                    #endregion
                };

Posted: 6 years ago

#6951 Quote
Reply from PayPal..


That's not an example request, it's only the code for your plugin.

As I mentioned, if your passing the state within your SetExpressCheckout request, it will be recorded within the EC token and thus retrievable later. Check your logs for the requests your plugin is submitting to determine if a value for state is being passed.

Posted: 6 years ago

#6952 Quote

Support

Posted: 6 years ago

#6952 Quote
I'll see how to save PayPal request.
But I think you didn't understand me. I use original PayPal SDK library for this request.

PayPal.Api.ItemList.shipping_address


This class is from original PayPal SDK library.
But I'll see how to save PayPal request.

Powered by nopCommerce

Copyright © 2023 FoxNetSoft. All rights reserved