Forums / Bug Reports / [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

[Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

Locked

Views: 5,535

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
23 May 2010, 5:34 PM
#1
stagebrace avatar

stagebrace

Totally Zenned

Join Date:
Jan 2005
Location:
Tennessee
Posts:
985
Plugin Contributions:
0

[Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

I noticed the PayPal emails returning sales info were missing the products details. I checked some data and found these variables were not being sent via DoExpressCheckoutPayment when using 139c versus 138.

L_NUMBER(x)
L_QTY(x)
L_NAME(x)
L_AMT(x)
L_TAXAMT(x)

23 May 2010, 10:15 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

It should only skip those kinds of items when there are discounts or calculation problems which would throw off PayPal's validation.

I'd need to see your detailed PayPalXXXXXXXXXX.log debug log files to know more why it's doing 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.

23 May 2010, 11:50 PM
#3
stagebrace avatar

stagebrace

Totally Zenned

Join Date:
Jan 2005
Location:
Tennessee
Posts:
985
Plugin Contributions:
0

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

OK, see attachment.
for password see PM

5 Jun 2010, 9:37 PM
#4
stagebrace avatar

stagebrace

Totally Zenned

Join Date:
Jan 2005
Location:
Tennessee
Posts:
985
Plugin Contributions:
0

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

I know this was not marked as fixed for 139d but I though I would see what it does. I installed the boilerplate store with no template changes. Installed PayPal express. Changed the price of an item to one dollar. And made a purchase.

Still missing. See attachment
L_NUMBER(x)
L_QTY(x)
L_NAME(x)
L_AMT(x)
L_TAXAMT(x)

This information is useful as a backup to the Zen Cart data. And PayPal can use it for "items not as described" complaints.

10 Jun 2010, 1:10 AM
#5
stagebrace avatar

stagebrace

Totally Zenned

Join Date:
Jan 2005
Location:
Tennessee
Posts:
985
Plugin Contributions:
0

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

The following modification fixed the issue for me. I warn it may not fix it for others.

replace a line 1262 in file paypalwpp.php
if ($sumofLineItems == 0) {

with
if ($sumofLineItems === 0) {

There must be a difference between being Equal and Identical. Or the change may just shut down the equation altogether and bypass the needed logic. I don't know, not smart enough. I need the line items and am willing to take the chance at the moment.

Dennis

10 Jun 2010, 6:19 PM
#6
stagebrace avatar

stagebrace

Totally Zenned

Join Date:
Jan 2005
Location:
Tennessee
Posts:
985
Plugin Contributions:
0

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

I may have found the bug.
Is
$sumofLineItems
and
$sumOfLineItems

two different varaiables?

12 Jun 2010, 5:52 PM
#7
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

Yes, that would be a problem. The uppercase "O" should be used.
We'll roll that fix into v1.3.9e.

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

12 Jun 2010, 6:07 PM
#8
stagebrace avatar

stagebrace

Totally Zenned

Join Date:
Jan 2005
Location:
Tennessee
Posts:
985
Plugin Contributions:
0

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

Dennis does the happy fat man dance around the house. Happy to make the find.:clap:

24 Jul 2010, 1:07 PM
#9
tanstaafl avatar

tanstaafl

New Zenner

Join Date:
Jul 2010
Posts:
1
Plugin Contributions:
0

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

Thank You Stagebrace ! Recently upgraded from 1.3.8a to 1.3.9d and found that order details were now missing from PayPal packing slips. Correcting the misspelling of the variable $sumOfLineItems solved the problem immediately. My PayPal packing slips are important to the business and now they work correctly.

24 Jul 2010, 8:28 PM
#10
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,844
Plugin Contributions:
17

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

Would that mean the $sumoLineTax should be changed as well?

Payphone line 606 and others. Seems like same case mistake everywhere sumofLineItems appears.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

24 Jul 2010, 11:30 PM
#11
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

dbltoe:

Would that mean the $sumoLineTax should be changed as well?

Payphone line 606 and others. Seems like same case mistake everywhere sumofLineItems appears.

Just skimmed through this file myself - I think you are right on the money.

$sumofLineTax only appears once in the whole file, no reference in any other formula.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

25 Jul 2010, 12:33 AM
#12
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,844
Plugin Contributions:
17

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

auto-spellchecker got me:shocking:

Payphone line 606 and others.shoulda been> shows up on line 1606 and other files.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

25 Jul 2010, 1:00 AM
#13
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

stagebrace:

The following modification fixed the issue for me. I warn it may not fix it for others.

replace a line 1262 in file paypalwpp.php
if ($sumofLineItems == 0) {

with
if ($sumofLineItems === 0) {

There must be a difference between being Equal and Identical. Or the change may just shut down the equation altogether and bypass the needed logic. I don't know, not smart enough. I need the line items and am willing to take the chance at the moment.

Dennis
I noticed your use of the triple = instead of the more common double. Although this is true for solving strange problems within JS, is it also true for PHP?

I also noticed 'paypalwpp.php' has neither a closing ?> nor EOF. Any concern with that?

The learning is in the doing.

Potent Products

25 Jul 2010, 2:03 AM
#14
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,844
Plugin Contributions:
17

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

Rob,
Need to read up a few posts. I think the === was not required once the sumofLineItems was changed to sumOfLineItems.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

25 Jul 2010, 2:40 AM
#15
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

Understood, but it is the specific use of === within PHP that I am curious about. I have only seen that used within JS.

The learning is in the doing.

Potent Products

25 Jul 2010, 4:18 AM
#16
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

Website Rob:

Understood, but it is the specific use of === within PHP that I am curious about. I have only seen that used within JS.

It's a perfectly valid operator in PHP when doing type-matching: http://php.net/manual/en/language.operators.comparison.php

And ... you're way off topic for this bug-fix thread :blush:

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

25 Jul 2010, 4:40 AM
#17
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

Website Rob:

I also noticed 'paypalwpp.php' has neither a closing ?> nor EOF. Any concern with that?That's been common practice now in Zen Cart for several years, starting in various files touched since v1.3.7.1: https://www.zen-cart.com/tutorials/index.php?article=313

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

27 Jul 2010, 5:26 AM
#18
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

NOTE: v1.3.9e has now been released and contains the fixes to the issue described by stagebrace initially. See the News & Announcements section of the forum for details.

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

27 Jul 2010, 7:24 PM
#19
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,844
Plugin Contributions:
17

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

$sumofLineTax is still at line 1264 of the paypalwpp.php:(

In the // Sanity Check> // Sanity Check of line-item subtotals

for ($j=0; $j<$k; $j++) {
  $itemAMT = $optionsLI["L_AMT$j"];
  $itemQTY = $optionsLI["L_QTY$j"];
  $itemTAX = (isset($optionsLI["L_TAXAMT$j"]) ? $optionsLI["L_TAXAMT$j"] : 0);
  $sumOfLineItems += ($itemQTY * $itemAMT);
  $sumOfLineTax += ($itemQTY * $itemTAX);
}
$sumOfLineItems = round($sumOfLineItems, 2);
$sumOfLineTax = round($sumOfLineTax, 2);

if ($sumOfLineItems == 0) {
  $sumofLineTax = 0;
  $optionsLI = array();
  $discountProblemsFlag = TRUE;
  if ($optionsST['SHIPPINGAMT'] == $optionsST['AMT']) {
    $optionsST['SHIPPINGAMT'] = 0;
  }
}

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

27 Jul 2010, 7:50 PM
#20
drbyte avatar

drbyte

Sensei

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

Re: [Done v1.3.9e/f] 139c DoExpressCheckoutPayment variables missing

So it is. :(

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