Jump to content


Photo

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


  • Please log in to reply
3 replies to this topic

#1 programguru

programguru
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts

Posted 20 October 2006 - 07:36 AM

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?

THIS FORUM KEEPS PUTTING ME IN MY PLACE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#2 btherl

btherl
  • Staff Alumni
  • Advanced Member
  • 3,893 posts
  • LocationAustralia

Posted 20 October 2006 - 07:51 AM

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.

#3 programguru

programguru
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts

Posted 20 October 2006 - 03:32 PM

btherl,

Thanks for the good point, but we attempted this already, and all numbers are being passed properly... It just does not make sense!
THIS FORUM KEEPS PUTTING ME IN MY PLACE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#4 Psycho

Psycho
  • Moderators
  • Move along, nothing to see here
  • 11,891 posts
  • LocationCanada

Posted 20 October 2006 - 04:25 PM

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.
The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users