Forums / Bug Reports / [Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

[Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

Locked

Views: 2,602

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
27 Apr 2010, 5:56 PM
#1
vooboo13 avatar

vooboo13

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

[Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

We've recently noticed that orders over $1000 have been capturing only $1, and $2000+ orders have been capturing $2.

I believe the issue is that when the sales team captures the money, they copy and paste the number which is $1,xxx.xx or $2,xxx.xx.

Is this a known issue? Is there a fix for this? I know the obvious solution is to not put the commas in, but I just want to know if there's a way to fix it in the code.

Vu Nguyen | Multimedia Developer & Webmaster
Robotics Academy/Robomatter
Robomatter Robotics Education Store

27 Apr 2010, 6:01 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: [Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

What version of Zen Cart?

.
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 Apr 2010, 6:03 PM
#3
vooboo13 avatar

vooboo13

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

Re: [Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

I'm currently using 1.3.8a

Also, I'm only guessing that this is what's causing the issue. If you can think of another reason then by all means.. I'm trying to figure out what's going on

Vu Nguyen | Multimedia Developer & Webmaster
Robotics Academy/Robomatter
Robomatter Robotics Education Store

27 Apr 2010, 6:08 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: [Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

/includes/modules/payment/linkpoint_api.php
around approx line 877 or so you'll see this section of code
Add the new line as shown:```
function _doCapt($oID, $amt = 0, $currency = 'USD') {
global $db, $messageStack;
[B] $_POST['captamt'] = preg_replace('/[^0-9.%]/', '', $_POST['captamt']);[/B]

.
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 Apr 2010, 6:08 PM
#5
vooboo13 avatar

vooboo13

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

Re: [Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

Thanks so much DrByte!

Just to be sure, are we not crazy that this is what caused the problem? I just want to make sure that it isn't something else.

Vu Nguyen | Multimedia Developer & Webmaster
Robotics Academy/Robomatter
Robomatter Robotics Education Store

27 Apr 2010, 6:13 PM
#6
drbyte avatar

drbyte

Sensei

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

Re: [Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

Yes. It wasn't stripping out characters other than digits and decimal points.
Granted, now if you were to switch to another currency that uses commas as the decimal indicator you'd be totally broken.

.
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 Apr 2010, 6:13 PM
#7
vooboo13 avatar

vooboo13

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

Re: [Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

Thanks again. Good to know, i'll keep that in mind if we ever add different currency.

Vu Nguyen | Multimedia Developer & Webmaster
Robotics Academy/Robomatter
Robomatter Robotics Education Store

27 Apr 2010, 6:16 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: [Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

Well, in hindsight, Linkpoint/Yourpay/Firstdata only supports USD anyway, so it's a moot issue at present.

.
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 Apr 2010, 6:19 PM
#9
vooboo13 avatar

vooboo13

New Zenner

Join Date:
Dec 2009
Posts:
55
Plugin Contributions:
0

Re: [Done 1.3.9b] Yourpay/FirstDATA credit card captures not processing commas correctly

Also good to know. We take international orders, but it processes it in USD so... haven't had issues with that yet.

Vu Nguyen | Multimedia Developer & Webmaster
Robotics Academy/Robomatter
Robomatter Robotics Education Store