Author Topic: PayPal Payment Plugin sending wrong state format  (Read 4455 times)

craigk292

  • Beginner
  • *
  • Posts: 4
PayPal Payment Plugin sending wrong state format
« on: May 14, 2013, 17:31:50 pm »
I am having a problem with how the PayPal Payment plugin is sending information to PayPal.  The attached file shows the PayPal page I am getting and shows the error.  Basically it says that the Shipping Address information is not correct.  I checked the information and it was absolutely correct so I called PayPal and spoke with there advanced support.  What he told me is that the state information is being sent in the wrong format....PayPal Plugin is sending the state as North Carolina but I'm told PayPal only accepts the acronym of NC.

Find below the email I was sent from Paypal Support.

Discussion Thread
Response Via Email (Bryce)   05/09/2013 09:46 AM


Hello Craig Kibbe,

My name is Bryce with PayPal Merchant Technical Services. I enjoyed speaking with you and hope you found our conversation helpful.

I tested your site the primary issue is the "state" is being passed as the name instead of the 2 digit abbreviation.

Since your cart is including the command "address_override=1" the buyer is unable to change the address on our site to correct it themselves.

Changing either the way the state is passed...PREFERRED or giving the buyer the ability to change the address would resolve the problem although I'd suggest at least changing "state" as it would be the better buyer experience.

To update this ticket, simply reply to this email or go to http://www.paypal.com/mts and click the “My Stuff” tab. To login, please enter your email address and password in the Returning Users area. The default password is your email address.

This ticket will remain pending for the next 7 days, if you have no further questions regarding this matter please reply and I will close this ticket.

Sincerely,
Bryce
Merchant Technical Services
PayPal, an eBay company


Anyone know how I can fix this problem?? :o

Here is my site information:

Address:  http://www.lifesensuals.com
*  Joomla 2.5.11
*  Jomsocial 2.8.3
*  AEC 1.2RC Revision 5942
*  Virtumart 2.0.20

Those are the primary Extensions.



[attachment cleanup by admin]

Mathalis

  • Beginner
  • *
  • Posts: 25
    • Mathalis Web Studio
  • Skype Name: mathaliswebstudio
Re: PayPal Payment Plugin sending wrong state format
« Reply #1 on: May 14, 2013, 21:17:48 pm »
Hello,
Are you in production server ?
Did you already encounter  these kind of  issue ?

So, in Payment Methods, in your paypal payment, in Configuration tab, you have a parameter called "Let buyers override their PayPal addresses?" set to No by defaut.

Try to turn on Yes and retry with this particular adresse or an other

Help this help you


Best regards

craigk292

  • Beginner
  • *
  • Posts: 4
Re: PayPal Payment Plugin sending wrong state format
« Reply #2 on: May 14, 2013, 23:23:56 pm »
Mathalis,

I'd already checked the Override and it is set the Yes.  It has been set to that way for several weeks.  This is not the problem.  More importantly, the proper setup would send NC to PayPal instead of North Carolina.  That is the proper way for the system to send the state information to PayPal.

Thanks,
Craig

samlf3rd

  • Jr. Member
  • **
  • Posts: 115
Re: PayPal Payment Plugin sending wrong state format
« Reply #3 on: May 14, 2013, 23:40:13 pm »
Sometimes you might try reinstalling the plugin.
What type of server on you on? Godaddy?
Is this a shared server or your own server?

Have you checked system information and made sure everything is writeable?

craigk292

  • Beginner
  • *
  • Posts: 4
Re: PayPal Payment Plugin sending wrong state format
« Reply #4 on: May 14, 2013, 23:55:55 pm »
The problem does not seem to be with the processing, but more to do with the data being sent.  Reinstalling the plugin would not correct the problem.  The State is being supplied from the Db.  The only way to correct this would simply be to change the table from the state's full name to abbreviated name... NC.  How can we make that happen?

samlf3rd

  • Jr. Member
  • **
  • Posts: 115
Re: PayPal Payment Plugin sending wrong state format
« Reply #5 on: May 15, 2013, 02:53:32 am »
Why would you be the only one that this happens to and not so many others? There is something wrong with your configuration somewhere or we would all be going through this.
I would install and run Admin tools just for the heck of it.

It just seems like someone changed some settings (as by default the plugin sends the correct address type) or made some core hacks. Has anything out of the norm been changed on your site since installation?

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2048
    • alatak.net
Re: PayPal Payment Plugin sending wrong state format
« Reply #6 on: May 15, 2013, 18:28:06 pm »
Hello

Quote
I tested your site the primary issue is the "state" is being passed as the name instead of the 2 digit abbreviation.
Yes you are rigth

The fix is the following
replace line 209
Code: [Select]
"state"            => isset($address->virtuemart_state_id) ? ShopFunctions::getStateByID ($address->virtuemart_state_id ) : '',with
Code: [Select]
"state"            => isset($address->virtuemart_state_id) ? ShopFunctions::getStateByID ($address->virtuemart_state_id, 'state_2_code') : '',

i am fixing it for the next version

craigk292

  • Beginner
  • *
  • Posts: 4
Re: PayPal Payment Plugin sending wrong state format
« Reply #7 on: May 15, 2013, 21:00:17 pm »
V,

That fixed it!!!!  You are my hero now!  That was a simple fix for a BIG PROBLEM! 

Thanks so much.  We can mark this one SOLVED!  :D

Craig

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2048
    • alatak.net
Re: PayPal Payment Plugin sending wrong state format
« Reply #8 on: May 15, 2013, 22:08:13 pm »
Hello
Great :)

sjshaffer

  • Beginner
  • *
  • Posts: 15
    • Urban Legend
  • VirtueMart Version: 3.2.8
Re: PayPal Payment Plugin sending wrong state format
« Reply #9 on: July 08, 2013, 19:13:18 pm »
Thank you both for posting this and providing a patch!

jpreskitt

  • Beginner
  • *
  • Posts: 40
Re: PayPal Payment Plugin sending wrong state format
« Reply #10 on: January 03, 2014, 22:42:22 pm »
Alatek,
I too have this problem. In VM  2.0.20b, what file specifically did you alter that code?
I'm holding off updating to the latest VM version b/c I am having conflicts with the new version.
Thank you in advance!
John


alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2048
    • alatak.net
Re: PayPal Payment Plugin sending wrong state format
« Reply #11 on: January 06, 2014, 08:54:06 am »
Hello
If you are using the 2.0.20b it is in the file plugins/vmpayment/paypal/paypal.php