When performing a Direct Post Tokenization the following parameters are required:
The credit card holders name
The credit card number
The card expiry month, 1 or 2 digits (e.g. 5, 12, 06)
The card expiry year, 4 digits (eg. 2023)
The CVV or Security Code on the back of the card - 3 digits
For Recurring transactions this field can be included set to true, which will make the cvv field optional. Defaults to
In addition to these fields the following hidden fields should also be included:
The URL to redirect the customer to with the response.
The verification value. Details on how to calculate this are below.
The URL for the Direct Post form should be:
There are several hidden fields in this form which are submitted to the Gateway from the customers browser. These are:
- return_path - the URL to return the customer to on completion
In order to ensure these values are not changed a verification value is also included, which is determined by the following:
verification = hmac_md5(shared_secret, "https://merchantswebsite.com/credit_card/callback");
Upon completion of the request the customer will be redirected back to the merchants website with a number of key/value pairs in the query string. These will be:
Response code indicating the outcome of the request - see the list below for details.
The credit card token
The card holders name
The masked card number - this can be stored if required
The card expiry date - this can be stored if required
The verification value used to verify the response integrity - see below for details on verification
Any errors related to the request - this will be populated if the response code is 90-999 (e.g. errors=Invalid+Card+Number)
The following response codes are used for Direct Post transactions:
Merchant Username not found
Validation error - there was an error validating the customers input (e.g. bad card number)
Invalid Verification - the verification was not successful indicating the data may have been tampered with
Gateway Error - contact support if this error persists
To verify the response hasn't been tampered with the merchants integration should perform the following verification calculation, and compare the result against the value of v:
If these values do not match the response should be considered invalid.
It is also important that a merchant's system be idempotent with handling responses, so that if a customer reloads the page they are redirected to the system will not treat each request as a new order.
In addition to the parameters mentioned above we now support echo parameters, which are values returned in the transaction.
To use these simply include them in your form using the following format for the field name
echo[your_param_name] and they will be included in the response URI.
As with the extra parameters above, the echo parameters are not included in the verification calculation.