Jump to content

Archived

This topic is now archived and is closed to further replies.

programguru

In interesting issue when passing amounts.. Anyone seen this before?

Recommended Posts

Ok simple breakdown:

All calculations and totals are generated on server-side, and being logged correctly, but incorrect amount is being passed to payment gateway.

here is a sample of what's happening:

Product A  Qty 2 @ 1.00 ea
Product C  Qty 1 @ 1.00 ea

Total amount being captured and sent in our var ordertotal in our reciept emails and admin sales table is $3.00, BUT when we send to process at the payment gateway, ONLY $2.00 is sent .. which clearly leads to the conclusion that the multiplication is not correct on QTY, but it store fine on our side.. It does not happen in all cases! Could this be a browser issue? It's my last resort as it's just not making sense!

SOS.. any ideas?

Share this post


Link to post
Share on other sites
I would try printing out the values you send to the gateway right before you send them.  You can display them in the browser or you can write them to a file.  If the gateway is receiving the wrong values, then printing out the values right before they are sent should show incorrect values too.

Then, if they are incorrect, you can work backwards until you find where they become incorrect.

Share this post


Link to post
Share on other sites
btherl,

Thanks for the good point, but we attempted this already, and all numbers are being passed properly... It just does not make sense!

Share this post


Link to post
Share on other sites
When you send data to the payment gateway are you sending quantities and per item prices or are you sending the total amount?

If you are sending quantities and per item amounts and you have verified that you are sending the correct numbers, check the documentation for the payment gateway. Perhaps you are not sending it in the correct format.

However, if you are sending just the order total, then the error must lie within your code. I ran into a similar issue on an application for my last company. The amount displayed to the users and in the administration was the same number, but there were some instances where the amount charged to the user's CC was off by 1-3 cents. It turned out that there were two different sets of processes to calculate the order total. One for calculating the amount for display purposes, then another process was done to calculate the amount to send to the bank. And there was a rounding error in one. Double check your code to be sure you are using the same function to determine the amount total.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.