Post by pristinenote » Wed Jan 09, 2013 3:28 am

Hi. I am quite intrigued by this event, I am sure you would find it interesting too. The good part is that I have seemed to have identified the problem.
I am based out a country, where the decimal place for the currency seems to have lost its value, sad but this is what the recession seem to have done. We use TPSL payment gateway, which doesnt seem to be very popular in other place.

The VAT structure in my country is 5%. In other words if my Gross price for a product is 100, the Net Price becomes 95.23809523809524...!!! This is where it all starts to get interesting :P

When the Net Price is fed in Product>Data>Price 95.2380 (it takes up to 4 decimal places). In the Invoice in check out price indicated is 100.00 ( I have 2 decimal places set in localization>Currency).

However the math now is

95.2380*1.05 = 99.9999

Which is correctly rounded off to 100.00 in the invoice. However when the information is sent to TPSL Payment Gateways is received as 99.9999 and not 100.00. The PG is not able to process the amount and the payment is declined!

Interestingly, when instead of 95.2380 we us 100 as the net amount.
The Gross amount (100*1.05=) 105 is processed correctly by the payment gateway.

I have concluded, by looking at the payment gateways log that the payment is correctly processed, when the amount is upto 2 decimal places and fails anytime the amount passed to the PG is more than 2 decimal places.

Is there a work around? Should I add a padding to the amount say 0.0001 to 99.9999 to make it 100.00 or is there any other workaround or module?

Any help would be greatly appreciated.

My website : http://www.proaudiohome.com
http://www.pristinenote.com


New member

Posts

Joined
Fri Jul 13, 2012 7:33 pm
Location - Mumbai, India

Post by pristinenote » Tue Jan 15, 2013 8:53 pm

Hi any workaround??

My website : http://www.proaudiohome.com
http://www.pristinenote.com


New member

Posts

Joined
Fri Jul 13, 2012 7:33 pm
Location - Mumbai, India

Post by pristinenote » Tue Jan 15, 2013 9:47 pm

Is there any way to force opencart do currency calculation with 2 decimal places instead of 4. In that case my problem would be solved!

My website : http://www.proaudiohome.com
http://www.pristinenote.com


New member

Posts

Joined
Fri Jul 13, 2012 7:33 pm
Location - Mumbai, India
Who is online

Users browsing this forum: No registered users and 4 guests