Forums / Addon Payment Modules / eway $1000 bug - help!

eway $1000 bug - help!

Locked

Started by emtecmedia on 9 Oct 2006, 7:17 AM · Views: 2,498

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
9 Oct 2006, 7:17 AM
#1
emtecmedia avatar

emtecmedia

Zen Follower

Join Date:
May 2005
Posts:
108
Plugin Contributions:
0

eway $1000 bug - help!

Hi,

I have installed the eway module i found on this forum but there is a bug with any order over the value of $1000, it only charges the customer $1 instead of $1000.

I believe it has something to do with line 231 of eway.php attached. Code is: $my_totalamount = number_format($order->info['total'], 2) * 100;

The idea is to convert the dollar and cent value to just cents, as eway processes all transactions in cents. So $25.25 would be 2525cents. But something goes wrong when the value is more than $1000.

If anyone has any ideas or experience with this kinda thing using other payment modules that would be great.

Thanks,
Brad.

9 Oct 2006, 7:34 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: eway $1000 bug - help!

This post addresses this bug, and a second one:
http://www.zen-cart.com/forum/showthread.php?t=41952

However, I believe the "correct" fix for this is the following:

$my_totalamount = number_format($order->info['total'], 2, '.', '') * 100;
```(This forces 2 decimal places, with a . to separate, and says to NOT use the standard comma as a thousands-separator.)

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

9 Oct 2006, 7:34 AM
#3
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: eway $1000 bug - help!

No experience at all with that module, but maybe it happens because 1000 is formatted as 1.000 or 1,000 ?

$my_totalamount = number_format($order->info['total'], 2, ',', '') * 100;
```(in which the hardcoded ',' should be replaced by the decimal separator definition?)

The second '' removes the thousands separator.
9 Oct 2006, 7:42 AM
#4
emtecmedia avatar

emtecmedia

Zen Follower

Join Date:
May 2005
Posts:
108
Plugin Contributions:
0

Re: eway $1000 bug - help!

Can anyone else confirm this would fix the problem?

9 Oct 2006, 7:57 AM
#5
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: eway $1000 bug - help!

Two isn't enough? ;-)
(one of which being a Zen Cart dev)

note: use DrByte's '.' in stead of my ',' .

(eway is from the US I assume now, where I live we usually use the ',' )

9 Oct 2006, 8:46 AM
#6
emtecmedia avatar

emtecmedia

Zen Follower

Join Date:
May 2005
Posts:
108
Plugin Contributions:
0

Re: eway $1000 bug - help!

Sorry, I only saw the 1 post before! :P Thanks guys, very much appreciated!

9 Oct 2006, 8:57 AM
#7
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: eway $1000 bug - help!

Sorry, I only saw the 1 post before!
Yeah, I already thought so :-)

22 Feb 2007, 3:39 AM
#8
reuben avatar

reuben

New Zenner

Join Date:
Apr 2005
Location:
Traralgon
Posts:
51
Plugin Contributions:
0

Re: eway $1000 bug - help!

Actually Dr Byte, eWay's policy is that amounts should be specified with no place holders at all.

Therefore your fix, according to eWay's spec, is "incorrect".

Cheeky.

26 May 2007, 11:58 PM
#9
xman888 avatar

xman888

Zen Follower

Join Date:
Jan 2007
Posts:
226
Plugin Contributions:
0

Re: eway $1000 bug - help!

Hello,

I have just installed the Eway Module, and was wondering if I too need to correct the $1000 bug, or if the Eway Module has been improved on since the bug became apparent.

Cheers,
Anthony

8 Oct 2007, 3:36 PM
#10
emupilot avatar

emupilot

New Zenner

Join Date:
Sep 2007
Posts:
21
Plugin Contributions:
1

Re: eway $1000 bug - help!

I believe I have fixed this issue in the new eway contrib.
Works for me but the latest version (2.1) is still being approved, wait for it, don't get v2.