If this is your first visit, check our documentation. To post, register or login.
Forums / Bug Reports / Paypal Error 10413 & Gift Certificates

Paypal Error 10413 & Gift Certificates

Started by gandalfsmith on 5 Oct 2011, 6:52 PM · Views: 2,152

Results 1 to 14 of 14
5 Oct 2011, 6:52 PM
#1
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Paypal Error 10413 & Gift Certificates

Zencart Version: 1.3.9
No recent upgrades

I have looked in the FAQ area and forum but cannot find an answer specific to my 10413/other errors. Help would be appreciated.

When on checkout page (using zencart & paypal express), if I apply a gift certificate less than the actual product/item amount = all works fine.

As per above, if I apply a gift certificate that is of equal value to the product/item amount = I get the 10413 order total error.

As per above, if I apply a gift certificate that is of higher value to the product/item amount = It goes through BUT on the paypal page on the left it does not break down any details, just shows a total amount.

I have tax enabled on both product and shipping
I have free shipping enabled on gift certificates only

5 Oct 2011, 7:09 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Paypal Error 10413 & Gift Certificates

Without seeing the logs from the transaction, it's difficult to know for sure what exactly is causing it, but it's most likely a rounding or calculation issue caused by the discounts combined with taxes and specials. It might even also be connected to having various order-total modules disabled.

The rounding issues have been addressed in v1.5.0 (there's a beta version available for testing), and so the problem should be resolved there.

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

5 Oct 2011, 7:21 PM
#3
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Paypal Error 10413 & Gift Certificates

I do have some log files, where should I put these for someone to check?

As for Order Total Modules the only ones not enabled are:
COD Fee, Discount Coupon, Low Order Fee

I can run a test on the 3 transactions again and give you the log files for each if that would help?

5 Oct 2011, 8:24 PM
#5
drbyte avatar

drbyte

Sensei

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

Re: Paypal Error 10413 & Gift Certificates

gandalfsmith:

I have free shipping enabled on gift certificates onlyHow? Why?

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

5 Oct 2011, 8:39 PM
#6
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Paypal Error 10413 & Gift Certificates

When you add gift certificates as a product, in the option fields I have set it to

  1. Product is Virtual: Yes, Skip Shipping Address
  2. Always Free Shipping: Yes, Always Free Shipping

I thought Gift Certificates did not require a shipping address? Plus I cannot charge shipping.

site address is https://www.mefyshop.com

5 Oct 2011, 8:48 PM
#7
drbyte avatar

drbyte

Sensei

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

Re: Paypal Error 10413 & Gift Certificates

gandalfsmith:

When you add gift certificates as a product, in the option fields I have set it to

  1. Product is Virtual: Yes, Skip Shipping Address
  2. Always Free Shipping: Yes, Always Free Shipping

I thought Gift Certificates did not require a shipping address? Plus I cannot charge shipping.
Oh. You're referring to the purchase of Gift Certificates. I had that confused with using Gift Certificates to pay for a purchase.
But those are completely unrelated issues.

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

5 Oct 2011, 8:50 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: Paypal Error 10413 & Gift Certificates

gandalfsmith:

I am attaching the log files per the 3 points above
In the case of redeeming GV greater than product amount, try making the following change to /includes/modules/payment/paypalwpp.php:
around line 1334 remove the code highlighted in red on the start of these lines where shown,
and for GV being the same as the product amount, add the = sign as shown:```
if (strval($optionsST['ITEMAMT']) <[B]=[/B] 0) {
$pre = (array_merge($optionsST, $optionsLI)); $optionsLI = array();
$optionsST['ITEMAMT'] = $optionsST['AMT'];
[B]if ($optionsST['AMT'] < $optionsST['TAXAMT'])[/B] $optionsST['TAXAMT'] = 0;
[B] if ($optionsST['AMT'] < $optionsST['SHIPPINGAMT'])[/B] $optionsST['SHIPPINGAMT'] = 0;
$discountProblemsFlag = TRUE;

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

5 Oct 2011, 8:53 PM
#9
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Paypal Error 10413 & Gift Certificates

DrByte:

Oh. You're referring to the purchase of Gift Certificates. I had that confused with using Gift Certificates to pay for a purchase.
But those are completely unrelated issues.

I do mean using gift certificates to "pay" for purchases. Or part pay. I.E. total is $80, product is $55. So if I put in a gift voucher to part pay for the order and the value is less than $55 it works.

If I put in a gift voucher amount of $55 to part pay it comes up with the 10413 error.

If I put in a gift voucher amount higher than $55, it goes through but on the paypal page it does not itemise anything - just gives a total.

5 Oct 2011, 8:56 PM
#10
drbyte avatar

drbyte

Sensei

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

Re: Paypal Error 10413 & Gift Certificates

Yes, I understand that. When you talked about free shipping on gift certificates, that has NOTHING to do with the PayPal problem, right?

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

5 Oct 2011, 10:58 PM
#11
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Paypal Error 10413 & Gift Certificates

DrByte:

Yes, I understand that. When you talked about free shipping on gift certificates, that has NOTHING to do with the PayPal problem, right?

Correct. I just added that in there as extra information.

5 Oct 2011, 11:18 PM
#12
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Paypal Error 10413 & Gift Certificates

DrByte:

In the case of redeeming GV greater than product amount, try making the following change to /includes/modules/payment/paypalwpp.php:

Thanks did that and this is what it fixed

  1. If I put in the GV amount as same as product amount [I no longer get the 14013 error] thanks for that.

However [see attached]
still not working correctly on the paypal part i.e. bringing in the correct details

  1. if GV amount is higher than product amount - just gives total in paypal
  2. if GV amount is same as product amount - just gives total in paypal
6 Oct 2011, 2:55 AM
#13
drbyte avatar

drbyte

Sensei

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

Re: Paypal Error 10413 & Gift Certificates

Yes, that's exactly what I expected it to do. The customer will see their complete order information in your store, in their My Account History, and in the order confirmation email they receive from your store. On the PayPal end, they'll simply see that they paid a certain "leftover amount" in their purchase ... again, the details are available in 3 other places, and not needed on the Paypal side.

PayPal won't allow the "product subtotal" to be less than 0. So, we can't submit an $80 GV against a $55 item and expect it to work, regardless whether the GV also covers shipping and taxes separately.

Doing it any other way gets VERY complicated, and is way beyond the scope of a simple quick "patch" of "change this line of code here". However, if you wish to tackle it yourself, you're certainly welcome to customize the code however you like.

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

6 Oct 2011, 3:00 PM
#14
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Paypal Error 10413 & Gift Certificates

Doing it any other way gets VERY complicated, and is way beyond the scope of a simple quick "patch" of "change this line of code here". However, if you wish to tackle it yourself, you're certainly welcome to customize the code however you like.

Thank you so much for your help much appreciated, at least the 10413 error is fixed. As you've explained to me I will explain to my client re the paypal side [makes sense]. :smile: