If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / PayPal Website Payments Pro support / International (Japan) Orders, Error 10735, WPP

International (Japan) Orders, Error 10735, WPP

Locked

Started by crystalkoi on 24 Jul 2008, 7:09 AM · Views: 4,093

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
24 Jul 2008, 7:09 AM
#1
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #1 by crystalkoi

I am trying to setup PayPal Websites Payments Pro for a client that is running their site in Japanese but they are located in Japan. They are shipping the products to Japan, and since, using Japanese addresses.

I keep getting an error of the fallowing.

10735 Invalid Data - There's an error with this transaction. Please enter a valid postal code in the shipping address.Japanese zip codes have 7 digits. I have tried to adjust the code of the paypalwpp.php file to this

'ZIP'         => substr($order->billing['postcode'], 0, 3) . '-' . substr($order->billing['postcode'], 3)));

But this doesn't work. So I if anyone knows and could help me find this. That would help me a ton.

Regards,

CKD

24 Jul 2008, 7:17 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Post #2 by kuroi

Is that a message being returned from Paypal?

This is pure hypothesis, but is it possible that Paypal doesn't like hyphens in postal codes? Can you try it with a space instead?

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

24 Jul 2008, 7:27 AM
#3
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #3 by crystalkoi

Hi Kuroi,

I tried this first without the hyphen. Same error. The error is located on the checkout page, and I am guessing this is from PayPal, as I don't see this error anywhere in the code.

The hyphen fixed the other Paypal problem I had before with the normal gateway for paypal. As you can see in this post here:

http://www.zen-cart.com/forum/showthread.php?t=92052

Any help would be great, I will put this in the Japanese Pack once I get it worked out.

Regards,

CKD

24 Jul 2008, 8:13 AM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Post #4 by kuroi

I can confirm that it is indeed a Paypal error code, but I think you'll need to ask Paypal directly what formats their system will accept.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

24 Jul 2008, 9:21 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #5 by drbyte

  1. "PayPal Website Payments Pro" is only available to US and UK merchants at the present time.
    I assume you really meant Express Checkout (even though the module's filename is paypalwpp.php)?

  2. If you turn on Debug Log To File in the module's settings in your admin area, it will generate several log files for each transaction. Please zip up all the files with "CURL" in the filename and post a link to the zip file for analysis.

  3. What version of Zen Cart are you using?

I was able to do a complete Express Checkout transaction using a common Japanese address and using a postal code formatted as 123-4567, with success.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 Jul 2008, 9:25 AM
#6
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #6 by crystalkoi

Kuroi,

Thanks for the help. I am checking my logs and it shows the array for the zip without the "-" in it. [SHIPTOZIP] => 3660825
[ZIP] => 3660825

So I am thinking this is the problem, as I know paypal takes the zip with a "-". I guess I didn't find the the right part of the code. Looking more into this.

Regards,

CKD

24 Jul 2008, 9:40 AM
#7
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #7 by crystalkoi

Hi DrByte,

My clients bank account is American. They are selling from America to Japan. I had talked to PayPal about this, and they said you can do it if the persons bank account that they apply with is located in America, the seller.

Anyways, I got it working. I had to change the file paypaldp.php to get it to work.

Line 499:

'ZIP' => substr($order->billing['postcode'], 0, 3) . '-' . substr($order->billing['postcode'], 3),

Line 515:

'SHIPTOZIP' => substr($order->delivery['postcode'], 0, 3) . '-' . substr($order->delivery['postcode'], 3),

I will add a country if statement to improve the code for the Japanese Pack. This is a great option for people selling from the US or UK to Japan.

Thanks for all the quick help!

Regards,

CKD

DrByte:

  1. "PayPal Website Payments Pro" is only available to US and UK merchants at the present time.
    I assume you really meant Express Checkout (even though the module's filename is paypalwpp.php)?

  2. If you turn on Debug Log To File in the module's settings in your admin area, it will generate several log files for each transaction. Please zip up all the files with "CURL" in the filename and post a link to the zip file for analysis.

  3. What version of Zen Cart are you using?

I was able to do a complete Express Checkout transaction using a common Japanese address and using a postal code formatted as 123-4567, with success.

24 Jul 2008, 10:40 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #8 by drbyte

I'm not convinced that's necessary.

Based on the testing I've done, if the customer has properly entered their postal code into Zen Cart with the hyphen included, there should be no need to edit the PHP code.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 Jul 2008, 11:04 AM
#9
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #9 by crystalkoi

Hi DrByte,

Well then its up to the user to not make a mistake in putting in their information. If I change the code, then the user will just put the numbers in and that will be it, the code will take care of the rest.

You see this as a bad way of fixing things? I guess I will just use a write up for the Japanese pack and give the person the choice.

Regards,

CKD

24 Jul 2008, 12:21 PM
#10
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #10 by crystalkoi

Hi DrByte,

I am going to agree here now. I am just going to add instructions for the Japanese side when creating an account to include a "-" in their zip code.

Thanks for schooling me there,

CKD

DrByte:

I'm not convinced that's necessary.

Based on the testing I've done, if the customer has properly entered their postal code into Zen Cart with the hyphen included, there should be no need to edit the PHP code.

24 Jul 2008, 4:59 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #11 by drbyte

After thinking about it further, I suspect that the ultimate solution would be to do full address validation at the time they supply their new address ... namely to validate the postal code and ensure that the correct number of digits is supplied and that the hyphen is inserted in the correct place. That way any payment or shipping module that uses that information will have accurate data to start with.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 Jul 2008, 5:53 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #13 by drbyte

CrystalKoi:

Hi DrByte,

You have a recommendation for a code change? I agree, this is the least amount of file changes.

Regards,

CKD
I suspect the easiest way to deal with Japan addresses is to add such a check in the address-book and create-account modules.

I'm pressed for time at the moment and won't be able to look at that part of the code for a few days. But the substr() methods you've been using will be useful, as well as stripping out any non-numeric characters. ie: strip out non-numbers, and then insert the hyphen in the correct position ... if the country is JP (I think that's #107 in ZC database).

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

28 Jul 2008, 2:48 AM
#14
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #14 by crystalkoi

Hi DrByte,

Just got back from the weekend. I will start to work on this some this week. Any tips you have would be great. I understand being busy, and I am thankful for your help

Regards,

CKD

28 Jul 2008, 6:51 AM
#15
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #15 by crystalkoi

Hi DrByte,

Here is what I have. I will need to place it where ever the input forms are.

if ((zen_db_prepare_input($_POST['zone_country_id']) == '107')) {
        $postcode = substr(zen_db_prepare_input($_POST['postcode']), 0, 3) . '-' . substr(zen_db_prepare_input($_POST['postcode']), -4);

    }else{
        
        $postcode = zen_db_prepare_input($_POST['postcode']);            
    }
```This way, no matter what they enter..if they do a 123-4567  or a 1234567, it will always come out 123-4567.

Do you see any error in this?

Regards,

CKD
29 Jul 2008, 8:39 AM
#16
crystalkoi avatar

crystalkoi

Zen Follower

Join Date:
Apr 2007
Posts:
181
Plugin Contributions:
0

Post #16 by crystalkoi

I applied the fallowing code to these files.

includes/modules/CUSTOM_TEMPLATE/checkout_new_address.php

includes/modules/CUSTOM_TEMPLATE/create_account.php

Core override:

includes/modules/pages/address_book_process/header_php.php

All seems to be working great now.

I will do some more testing and add it to the Japanese Pack. Also, need to add some updated language files for this.

Regards,

CKD

1 Aug 2008, 8:27 PM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #17 by drbyte

I don't see anything wrong with that.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.