Forums / PayPal Express Checkout support / PayPal 10413 error

PayPal 10413 error

Locked

Started by jurjenruben on 15 Jan 2008, 4:06 PM · Views: 45,812

Results 41 to 60 of 93
This thread is locked. New replies are disabled.
21 Sep 2008, 2:59 PM
#41
monsz avatar

monsz

New Zenner

Join Date:
Feb 2008
Posts:
13
Plugin Contributions:
0

PayPal 10413 error

Hi!

I found a solution about this problem.
I'm testing it now, but i share it with you, because it passed the first tests.

I think the paypal is calculate with the tax ['TAXAMT'], shipping cost ['SHIPPINGAMT'], handling cost ['HANDLINGAMT'], but these costs are in the total cost ['AMT']. So, if i don't send the subtotals to the paypal, only the total cost, this problem will ending...

So there's a the paypalwpp.php file in includes/modules/payment directory.

I inserted to 1519-1522 rows this code:

    unset($optionsST['TAXAMT']);
    unset($optionsST['SHIPPINGAMT']);
    unset($optionsST['HANDLINGAMT']);

After this modification, the paypal express checkout working properly, i tried it with tax, and with two different shipping mods.

21 Sep 2008, 8:39 PM
#42
dieuxsoldat_04 avatar

dieuxsoldat_04

Zen Follower

Join Date:
Jan 2008
Location:
Southern California Coast
Posts:
174
Plugin Contributions:
0

Re: PayPal 10413 error

Awesome man. Run a few more tests could you, and verify it is a resolute fix?

I kind of figured with was a cumulative data problem but when I turned of ot configs, I would be breaking the Cal State Tax Laws, so that wasn't an option but since this still calculates the tax and displays it but doesn't have PayPal process any of the information, it should be a legal fix.

Once I get my Test Site up I will see if this works!

Thanks again!

  • Jason

General Manager, Lead Designer and Web Master of Endless Sonata

22 Sep 2008, 10:37 PM
#43
eye_will avatar

eye_will

New Zenner

Join Date:
Sep 2007
Posts:
51
Plugin Contributions:
0

Re: PayPal 10413 error

Jason,

I have given up. I am converting all my products to display without tax and just sell in the UK. I am changing all the Totals in the site to say Total (including Tax). I have to change the attributes to not include tax and have changed the postage to exclude VAT.

Not an answer, but the only guarantee way to still be able to use pay pal and secure sales without losing all your tax.

Will

If anyone can correct the module it would be much appreciated.

23 Sep 2008, 1:03 AM
#44
monsz avatar

monsz

New Zenner

Join Date:
Feb 2008
Posts:
13
Plugin Contributions:
0

Re: PayPal 10413 error

If you can, test this:
http://www.zen-cart.com/forum/showpost.php?p=614935&postcount=26

eye will:

Jason,

I have given up. I am converting all my products to display without tax and just sell in the UK. I am changing all the Totals in the site to say Total (including Tax). I have to change the attributes to not include tax and have changed the postage to exclude VAT.

Not an answer, but the only guarantee way to still be able to use pay pal and secure sales without losing all your tax.

Will

If anyone can correct the module it would be much appreciated.

23 Sep 2008, 11:17 AM
#45
monsz avatar

monsz

New Zenner

Join Date:
Feb 2008
Posts:
13
Plugin Contributions:
0

Re: PayPal 10413 error

Hmm, sorry, this link is for paypal express checkout, not paypal website payment pro.

Monsz:

If you can, test this:
http://www.zen-cart.com/forum/showpost.php?p=614935&postcount=26

For website payment pro module, i think the filename is 'paypaldp.php', and maybe insert a code to rows 1301-1303 (after this:

    // subtotals have to add up to AMT
    // Thus, if there is a discrepancy, make adjustment to HANDLINGAMT:
    $st = $optionsST['ITEMAMT'] + $optionsST['TAXAMT'] + $optionsST['SHIPPINGAMT'] + $optionsST['HANDLINGAMT'];
    if ($st != $optionsST['AMT']) $optionsST['HANDLINGAMT'] += strval($optionsST['AMT'] - $st);

).

So insert this to rows 1301-1303:

    unset($optionsST['TAXAMT']);
    unset($optionsST['SHIPPINGAMT']);
    unset($optionsST['HANDLINGAMT']);

I don't use website payment pro, so i don't try this code in this modul, but the function content is look like to function in paypalwpp.php.

25 Sep 2008, 2:51 AM
#46
dieuxsoldat_04 avatar

dieuxsoldat_04

Zen Follower

Join Date:
Jan 2008
Location:
Southern California Coast
Posts:
174
Plugin Contributions:
0

Re: PayPal 10413 error

I will try the fix for PayPal Express Checkout. I have given all visitors a one month advance of scheduled downtime for the first week of October. So I can test soon.

Eye Will, what is it your are talking about attributes being involve din tax? I have any attributes to my items but none add price but I never set any configurations for tax and etc. Could this be one fo the issues I am having?

  • Jason

General Manager, Lead Designer and Web Master of Endless Sonata

30 Sep 2008, 2:00 AM
#47
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: PayPal 10413 error

My client's customers are also getting the 10413 error. It's weird because initially this was all working fine..

From what we've been able to gather from the customers who've gotten the error, the error occurs when they use the PayPal Express option from the shopping cart. We've made no changes to the cart, and the only mods installed are as follows:

  1. FedEx shipping module
  2. Captcha (Andrew's version)
  3. Returns Authorization

Here's the PayPal Express configuration:

Enable this Payment Module
True

Sort order of display.
15

Payment Zone
--none--

Set Order Status
Processing [2]

Set Unpaid Order Status
Pending [1]

Set Refund Order Status
Pending [1]

Express Checkout: Require Confirmed Address
No

Express Checkout: Select Cheapest Shipping Automatically
Yes

Express Checkout: Skip Payment Page
Yes

Express Checkout: Automatic Account Creation
Yes

Payment Action
Final Sale

Transaction Currency
Selected Currency

PayPal Page Style
Primary

API Signature -- Username
xxxxx_xxxx.xxxxxxxxx.com

API Signature -- Password
xxxxxxxxxxxxxxxx

API Signature -- Signature Code
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-
XXXXXXXXXXXXXXXXXX

PayPal Mode
PayPal

Live or Sandbox
live

Debug Mode
OffHere's the PayPal Payments Pro configuration:
Enable this Payment Module
True

Sort order of display.
10

Payment Zone
--none--

Set Order Status
Processing [2]

Set Unpaid Order Status
Pending [1]

Payment Action
Final Sale

Transaction Currency
Selected Currency

PayPal Mode
PayPal

Live or Sandbox
live

Debug Mode
OffThis is the order totals modules and their sort orders:
Sub-Total - ot_subtotal - 100
Info Shipping - ot_shipping - 200
Info Discount Coupon - ot_coupon - 280
Info Group Discount - ot_group_pricing - 290
Info Tax - ot_tax - 300
Info Low Order Fee - ot_loworderfee - 400
Info Gift Certificates - ot_gv - 840
Info Total - ot_total - 999
Info COD Fee - ot_cod_fee

There is nothing special about this client's orders.. He does not offer discounts, coupons or gift certificates. Taxes are only calculated and collected for California residents. None of the customers who reported the issue were California customers. (One lives in the UK, the other is from Chicago, IL)

All of the order modules are turned on except ot_cod_fee. (should the unsued total modules be turned off??)

My client wanting to turn off the PayPal Express option. He is planning on contacting PayPal to see if they will give him their blessing to turn off this option temporarily while we try to get to the root of the issue.. I on the other hand am totally confused.. Is there a direction I can move in??

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

30 Sep 2008, 9:59 AM
#48
monsz avatar

monsz

New Zenner

Join Date:
Feb 2008
Posts:
13
Plugin Contributions:
0

Re: PayPal 10413 error

Did you try what i wrote?

30 Sep 2008, 11:54 PM
#49
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: PayPal 10413 error

Monsz:

Hmm, sorry, this link is for paypal express checkout, not paypal website payment pro.

For website payment pro module, i think the filename is 'paypaldp.php', and maybe insert a code to rows 1301-1303 (after this:

// subtotals have to add up to AMT
// Thus, if there is a discrepancy, make adjustment to HANDLINGAMT:
$st = $optionsST['ITEMAMT'] + $optionsST['TAXAMT'] + $optionsST['SHIPPINGAMT'] + $optionsST['HANDLINGAMT'];
if ($st != $optionsST['AMT']) $optionsST['HANDLINGAMT'] += strval($optionsST['AMT'] - $st);
> 
> So insert this to rows 1301-1303:
> ```php
    unset($optionsST['TAXAMT']);
    unset($optionsST['SHIPPINGAMT']);
    unset($optionsST['HANDLINGAMT']);
```I don't use website payment pro, so i don't try this code in this modul, but the function content is look like to function in paypalwpp.php.

I'm a little confused, and I just want to understand before I make this change.. Would un-commenting lines 1302-1303 be the same as what you are suggesting??

/* //PayPal API spec contradicts itself ... and apparently neither of these "requirements" are enforced.
//Thus skipping this section for now:

// according to API specs, these cannot be set if they contain zero values, so unset if they are zero:
if ($optionsST['TAXAMT'] == 0)      unset($optionsST['TAXAMT']);
if ($optionsST['SHIPPINGAMT'] == 0) unset($optionsST['SHIPPINGAMT']);
if ($optionsST['HANDLINGAMT'] == 0) unset($optionsST['HANDLINGAMT']);
// set missing subtotals if they are zero values, since all must be submitted
if (!isset($optionsST['TAXAMT']))      $optionsST['TAXAMT'] = 0;
if (!isset($optionsST['SHIPPINGAMT'])) $optionsST['SHIPPINGAMT'] = 0;
if (!isset($optionsST['HANDLINGAMT'])) $optionsST['HANDLINGAMT'] = 0;

*/

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

1 Oct 2008, 8:39 AM
#50
monsz avatar

monsz

New Zenner

Join Date:
Feb 2008
Posts:
13
Plugin Contributions:
0

Re: PayPal 10413 error

What I did was: In paypaldp.php (Paypal Website Payments Pro class) insert this code to the rows 1301-1303, in paypalwpp.php (Paypal Express Checkout) insert to the rows 1519-1522:

    unset($optionsST['TAXAMT']);
    unset($optionsST['SHIPPINGAMT']);
    unset($optionsST['HANDLINGAMT']);  

The modified code will like this in both files:

    // subtotals have to add up to AMT
    // Thus, if there is a discrepancy, make adjustment to HANDLINGAMT:
    $st = $optionsST['ITEMAMT'] + $optionsST['TAXAMT'] + $optionsST['SHIPPINGAMT'] + $optionsST['HANDLINGAMT'];
    if ($st != $optionsST['AMT']) $optionsST['HANDLINGAMT'] += strval($optionsST['AMT'] - $st);


		//**************inserted code for unset subtotals********************************************************************
    unset($optionsST['TAXAMT']);
    unset($optionsST['SHIPPINGAMT']);
    unset($optionsST['HANDLINGAMT']);
		//*********************************************************************************************

/*  //PayPal API spec contradicts itself ... and apparently neither of these "requirements" are enforced. 
    //Thus skipping this section for now:

I suggest you, before make the change, backup both files, if you make mistake, you can upload the original files.

1 Oct 2008, 2:44 PM
#51
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: PayPal 10413 error

Thanks for the clarified code.. and it's not that I am not grateful..:P but I still want to understand something.. I found this commented out code in BOTH PayPal files

/*  //PayPal API spec contradicts itself ... and apparently neither of these "requirements" are enforced. 
    //Thus skipping this section for now:

    // according to API specs, these cannot be set if they contain zero values, so unset if they are zero:
    if ($optionsST['TAXAMT'] == 0)      unset($optionsST['TAXAMT']);
    if ($optionsST['SHIPPINGAMT'] == 0) unset($optionsST['SHIPPINGAMT']);
    if ($optionsST['HANDLINGAMT'] == 0) unset($optionsST['HANDLINGAMT']);
    // set missing subtotals if they are zero values, since all must be submitted
    if (!isset($optionsST['TAXAMT']))      $optionsST['TAXAMT'] = 0;
    if (!isset($optionsST['SHIPPINGAMT'])) $optionsST['SHIPPINGAMT'] = 0;
    if (!isset($optionsST['HANDLINGAMT'])) $optionsST['HANDLINGAMT'] = 0;
*/
```Wouldn't un-commenting this code be the SAME/SIMILAR as what you are suggesting I do to modify to these files???

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

1 Oct 2008, 5:26 PM
#52
monsz avatar

monsz

New Zenner

Join Date:
Feb 2008
Posts:
13
Plugin Contributions:
0

Re: PayPal 10413 error

That commented code is content many "if" structures, so that code isn't good for us. We need unset the subtotal values always, so the best way if you insert the three rows, what i wrote:)

DivaVocals:

Thanks for the clarified code.. and it's not that I am not grateful..:P but I still want to understand something.. I found this commented out code in BOTH PayPal files

/* //PayPal API spec contradicts itself ... and apparently neither of these "requirements" are enforced.
//Thus skipping this section for now:

// according to API specs, these cannot be set if they contain zero values, so unset if they are zero:
if ($optionsST['TAXAMT'] == 0)      unset($optionsST['TAXAMT']);
if ($optionsST['SHIPPINGAMT'] == 0) unset($optionsST['SHIPPINGAMT']);
if ($optionsST['HANDLINGAMT'] == 0) unset($optionsST['HANDLINGAMT']);
// set missing subtotals if they are zero values, since all must be submitted
if (!isset($optionsST['TAXAMT']))      $optionsST['TAXAMT'] = 0;
if (!isset($optionsST['SHIPPINGAMT'])) $optionsST['SHIPPINGAMT'] = 0;
if (!isset($optionsST['HANDLINGAMT'])) $optionsST['HANDLINGAMT'] = 0;

*/

1 Oct 2008, 9:14 PM
#53
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: PayPal 10413 error

Got it.. I'll give your fix a try.. Nothing else works.. and you fix makes logical sense considering that this is a totaling error or some sort..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

7 Oct 2008, 2:50 AM
#54
dieuxsoldat_04 avatar

dieuxsoldat_04

Zen Follower

Join Date:
Jan 2008
Location:
Southern California Coast
Posts:
174
Plugin Contributions:
0

Re: PayPal 10413 error

Any news?

  • Jason

General Manager, Lead Designer and Web Master of Endless Sonata

7 Oct 2008, 7:26 PM
#55
monsz avatar

monsz

New Zenner

Join Date:
Feb 2008
Posts:
13
Plugin Contributions:
0

Re: PayPal 10413 error

The fix resolved the problem in the webshop what i created.
The shop's running properly for three weeks, there was many transactions via paypal, and everything is ok :)

DieuxSoldat_04:

Any news?

  • Jason
7 Oct 2008, 7:39 PM
#56
dieuxsoldat_04 avatar

dieuxsoldat_04

Zen Follower

Join Date:
Jan 2008
Location:
Southern California Coast
Posts:
174
Plugin Contributions:
0

Re: PayPal 10413 error

I am actually doing some tests right now. So far so good. Great job finding this Monz. Will let you know if the fix seems resolute in a moment.

  • Jason

General Manager, Lead Designer and Web Master of Endless Sonata

7 Oct 2008, 11:39 PM
#57
dieuxsoldat_04 avatar

dieuxsoldat_04

Zen Follower

Join Date:
Jan 2008
Location:
Southern California Coast
Posts:
174
Plugin Contributions:
0

Re: PayPal 10413 error

Testing Completed
Test performed with PayPal Developer Sandbox accounts.
Test used 3 Accounts, 3 Products, 3 Attributes, 3 price ranges, and 3 different sized items.

  • Test Account 1
  • Purchased Product A: Succeeded
  • Price $1077.49
  • Attribute D
  • Large Sized Item
  • Test Account 2
  • Purchased Product B: Succeeded
  • Price $592.61
  • Attribute C
  • Medium Sized Item
  • Test Account 3
  • Purchased Product C: Succeeded
  • Price $183.16
  • Attribute A
  • Small Sized Item

So three different tests with three different items varying by hundreds in price, shape and weight, and attributes, yet all of them worked! I think this might be it Captain!

Nothing seems to be a problem for Zen Cart to communicate to PayPal now. Everything seems functional. If a few others can also confirm this works, I think this would be the most resolute fix. All the other ones I tried only worked for some people or continued to have random errors later on.

To credit Monsz: Original Post

Good job mate!

Thanks!
Warm Regards,
Jason

General Manager, Lead Designer and Web Master of Endless Sonata

8 Oct 2008, 12:28 AM
#58
drbyte avatar

drbyte

Sensei

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

Re: PayPal 10413 error

If you leave out those values, what happens to the receipt issued by PayPal?

.
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.

8 Oct 2008, 12:40 AM
#59
dieuxsoldat_04 avatar

dieuxsoldat_04

Zen Follower

Join Date:
Jan 2008
Location:
Southern California Coast
Posts:
174
Plugin Contributions:
0

Re: PayPal 10413 error

Hey Doc,

No difference really. Just displays the total the store displays at checkout. I included an image just in case this isn't the receipt :P. Sandbox accounts use fake email addresses so I'm not sure if it is the receipt but I did log in to the Sandbox Buyer account and click on "Details" for the test purchase.

Supposed Receipt.

Let me know if it seems right.

  • Jason

Edit:

To me, as long as the right amount is charged and the total is the same as indicated on my store, then it's ok with me, heh.

Also, I was wondering, PayPal charges a percentage of the transaction as a fee right? Then would it be possible to make the Zen Cart add that charge to all PayPal payments or have the PayPal account itself do it so the customer is charged the fee? I probably won't do it but would be nice to know, ; ].

General Manager, Lead Designer and Web Master of Endless Sonata

15 Oct 2008, 7:32 PM
#60
heapy avatar

heapy

New Zenner

Join Date:
Sep 2007
Posts:
12
Plugin Contributions:
0

Re: PayPal 10413 error

This fix worked perfectly for me:smile:

Thanks very much