Gokul Gokul - 1 year ago 179
PHP Question

The transaction was not sent to the host because of a duplicate order id

Moneris payment gateway issues my form code is like this

<FORM METHOD="POST" ACTION="https://www3.moneris.com/HPPDP/index.php">
<INPUT TYPE="HIDDEN" NAME="ps_store_id" VALUE="xxxxxxxx">
<INPUT TYPE="HIDDEN" NAME="hpp_key" VALUE="xxxxxxx">
<INPUT TYPE="HIDDEN" NAME="charge_total" VALUE="1.00">
<INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Click to proceed to Secure Page">

This code was running properly for the past few months. But now I've suddenly started getting an error message:

The transaction was not sent to the host because of a duplicate order id

This is on all my transactions. Could you please help me to fix it? Thanks in advance/

Answer Source

There must be an order ID in your code somewhere else. I tested the above code in both Moneris production and in Moneris QA and it worked without any errors.

If you don't specify an Order ID in your code then moneris will automatically generate a unique order ID for you.

In your response variables (that you recieved back from Moneris) you have this variable response listed:

 [response_order_id] => Cup150513 

However Cup150513 is not a Moneris Hosted Pay Page generated order ID. A Moneris Hosted Pay Page order ID will always start with mhp for example: mhp123456789. Since there's no order ID specified in the above code snippet - and since the above code works - it means that the order ID must be somewhere else in your code.

Here's what you can do:

  1. Look for the keywords order_id and Cup in your code to find out where the order ID is being generated.

  2. Remove the code that generates the order ID or change the code so that the order ID is always unique

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download