Jump to content

Paypal Pro plugin: Delivery Address Validation Problems


CBGitty

Recommended Posts

I recently upgraded to 5.1.5 and re-enabled the Paypal_Pro plugin, hoping that some of the issues I ran into last time had been sorted out.

 

The issue I am seeing now is with customers whose address entered in CubeCart is not technically valid according to the USPS. In these cases, two problems occur in regards to PayPal:

 

1) If they click the "Check out with Paypal" button, they are taken to a blank page.

2) If they instead click through the Checkout process, and then choose Paypal from the list of enabled payment methods, they briefly see a message regarding the address being rejected, and then they are taken to a Paypal error screen which mentions a bad merchant configuration/etc.

 

If the customer corrects his/her address to the USPS-approved version, then Paypal works as intended.

 

I have poked about through the likely suspects in terms of files where this check might be happening, but I can't seem to find it. Anyone know how to disable/override it?

Link to comment
Share on other sites

I have looked in my request log and found the entry for the error returned from PayPal. The somewhat cryptic error message being displayed to the user is originating with PayPal, which explains why I could not find it in the CubeCart language files. Here is the returned data entry:

 

 

Response received
TIMESTAMP=2013%2d01%2d11T18%3a16%3a47Z&CORRELATIONID=122e95b0c2e02&ACK=Failure&VERSION=65%2e0&BUILD=4181146&L_ERRORCODE0=10736&L_SHORTMESSAGE0=Shipping%20Address%20Invalid%20City%20State%20Postal%20Code&L_LONGMESSAGE0=A%20match%20of%20the%20Shipping%20Address%20City%2c%20State%2c%20and%20Postal%20Code%20failed%2e&L_SEVERITYCODE0=Error
Link to comment
Share on other sites

I am starting to think that it is due to artifact address issues left over from earlier upgrades. In the failed request, the state was passed as "California" and in the successful one after address edit it was passed as "CA". In the addressbook table, there are are a range of non-standard entries in the state field. I am going to try running some routines to standardize those to state codes and see if that helps.

Link to comment
Share on other sites

It is apparently some deeper issue... a newly-registered customer just had the problem, with her full state name being passed instead of the abbreviation.

 

Line 60 of /modules/plugins/PayPal_Pro/gateway.class.php may be playing a role:

 

$state = ($this->_basket['billing_address']['country_iso']=='US' || $this->_basket['billing_address']['country_iso']=='CA') ? $this->_basket['billing_address']['state_abbrev'] : $this->_basket['billing_address']['state'];

Link to comment
Share on other sites

It looks like the issue may actually be in the order creation code, not the PayPal_Pro module... when I cehcked the CubeCart_order_summary table, the 'state' field for the failed order had the full state name instead of the ID number. So the bug appears to be in the order creation/checkout process... Though some validation in the module code to make sure valid values are being passed to PayPal sure would be a nice idea.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...