Causes of the signature computation error

The fields of the form have not been encoded in UTF-8.

When computing the signature, if the fields are not sent to the gateway in UTF8 encoding, you will find special characters, such as accents, in the form.

Error example

[vads_capture_delay=]
[vads_site_id=51872022]
[vads_payment_config=SINGLE]
[vads_version=V2]
[vads_currency=978]
[vads_amount=1000]
[vads_cust_name=Ren�e Martin]
[vads_ctx_mode=PRODUCTION]
[vads_trans_date=20181026083000]
[vads_trans_id=982415]
[vads_payment_cards=]
[signature=ycA5Do5tNvsnKdc/eP1bj2xa19z9q3iWPy9/rpesfS0=]	
									

In this example you can see that the accents are not well encoded for the vads_cust_name field.

Make sure you handle UTF-8 encoding correctly in order to avoid signature errors.

Warning

We would like to remind you that the fields returned by the gateway are encoded in UTF-8. Therefore, there is no need to reapply UTF-8 encoding to the data returned by us.

The MODE (TEST or PRODUCTION) or the key is incorrect.

You can use the gateway in TEST or PRODUCTION mode.

Each mode has its key. Make sure that you use the correct key according to the desired mode.

Check your key in the Settings > Shop menu > in the Keys tab of your Merchant Back Office.

Warning: Line break or carriage return submitted in the form.

If you insert some carriage returns or line breaks within one of the posted values, they will not be taken in account.

Error example

If in the address field you post:

3 bellflower street

2nd floor apt 28

The value taken in account by the payment gateway will only be:

3 bellflower street

Then the payment gateway will only take the 3 bellflower street value in account to compute the signature whereas your signature computation will be based on the complete address: 3 bellflower street 2nd floor apt 28.

So you will get a signature computation error.

CONCLUSION: Before computing the signature and sending the form, you must avoid the carriage returns and line breaks.

Warning: Quotation marks ["] submitted in the form.

If you insert quotation marks within one of the posted values, they will not be taken in account.

Example:

If in the address field you post:

"Bellflower" Residence

The value taken in account by the payment gateway will only be:

Residence

Therefore, the payment gateway will only take the Residence value in account to compute the signature, whereas your signature computation will be based on the complete address: "Bellflower" Residence.

Thus, you will get a signature computation error.

CONCLUSION: Before computing the signature and sending the form, you must remove the quotation marks.

The transmitted signature does not respect the rule of signature computation. When computing the signature, the fields must be UTF-8 encoded. The same applies to your shop which must send all the parameters in UTF-8 encoding to the payment gateway.

Check that you have not forgotten a parameter or added an optional parameter.

Make sure the sorting was done correctly.

Reminder of the computation method

  1. Sort the fields starting with vads_ alphabetically.
  2. Concatenate the values of these fields separating them with the “+” character.
  3. Add the value of the key at the end of the chain separating them with the “+” character.
  4. According to the signature algorithm defined in your shop configuration:
    1. if your shop is configured to use “SHA-1”, apply the SHA-1 hash function to the chain obtained during the previous step.
    2. if your shop is configured to use “HMAC-SHA-256”, compute and encode in Base64 format the message signature using the HMAC-SHA-256 algorithm with the following parameters:
      • the SHA-256 hash function,
      • the test or production key (depending on the value of the vads_ctx_mode field) as a shared key,
      • the result of the previous step as the message to authenticate.

For more information, see chapter Computing the signature in the Hosted Payment Page Implementation Guide.

If you have confided the administration of your shop to a Web agency, send them the e-mail notification you received.