Jump to content

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


programguru

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?
Link to comment
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.
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.