With the Smarty function formHash, you can generate a SHA1, SHA256, SHA512, MD5 string based on input elements on a signup/update page. This hash is generated when the page loads and is added as a hidden input to the form element on your page. This solution is used by some payment systems to authenticate a payment. After validation, the visitor is directed to the payment process.
This solution can be used for integrations with payment systems like Buckaroo or Ogone based on SHA1 encoding, among other use cases.
Arguments
The following arguments can be used in the current function:
Argument | Description |
---|---|
algoritm | The algorithm applied to generate the encoded hash is SHA1 by default.
|
hashname | The name of the (hidden) input where the hash should be added. |
fieldnames | In this argument, you should provide a comma-separated list of all field names of the input elements that are relevant for building the hash. |
separator | The option to separate the values of the input fields with a character. This argument is empty by default. |
passphrase | This field contains the secret key for building the hash. |
passphrasemode | It's possible to add the secret key for each value individually or once for the entire string before hashing it. By default, the secret key will be applied to each value. However, if the status contains "once," it will be applied only to the first value. |
ucfieldnames | A boolean that, when set to true, translates all fields specified in the 'fieldnames' element to uppercase.
|
lcfieldnames | A boolean that, when set to true, translates all fields specified in the 'fieldnames' element to lowercase.
|
uchash | A boolean to translate the resulting hash to all uppercase.
|