[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.
Re: Yourpay/FirstDATA credit card captures not processing commas correctly
What version of Zen Cart?
Re: 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
Re: 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:
Code:
function _doCapt($oID, $amt = 0, $currency = 'USD') {
global $db, $messageStack;
$_POST['captamt'] = preg_replace('/[^0-9.%]/', '', $_POST['captamt']);
Re: 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.
Re: 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.
Re: 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.
Re: 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.
Re: 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.