Paid feature

This is a paid feature. If you need more information, please contact tpm@deployteq.com for further details.

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.

formHash

{{formHash algoritm='sha1' hashname='SHASign' fieldnames='PSPID, amount, orderID, EMAIL' passphrase='123' ucfieldnames=true uchash=true}} 
   {{input name='PSPID' type='hidden' field='environment' value='BBPGES'}}
   {{input name='orderID' type='hidden' field='environment' value='EEC202312'}}
   {{input name='amount' type='hidden' field='environment' value='200.50'}}
   {{input name='EMAIL' type='hidden' field='environment' value=$customer.emailaddress}}
{{/formHash}}  

Arguments

The following arguments can be used in the current function:

ArgumentDescription
algoritm

The algorithm applied to generate the encoded hash is SHA1 by default.

  • SHA1
  • SHA256
  • SHA512
  • MD5
hashnameThe name of the (hidden) input where the hash should be added.
fieldnamesIn this argument, you should provide a comma-separated list of all field names of the input elements that are relevant for building the hash.
separatorThe option to separate the values of the input fields with a character. This argument is empty by default.
passphraseThis 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.

  • true
  • false
lcfieldnames

A boolean that, when set to true, translates all fields specified in the 'fieldnames' element to lowercase.

  • true
  • false
uchash

A boolean to translate the resulting hash to all uppercase.

  • true
  • false


Examples

formHash

{{form name='formHash example'}}
        {{formHash algoritm='sha1' hashname='SHASign' fieldnames='PSPID, amount, orderID, EMAIL' passphrase='123' ucfieldnames=true uchash=true}} 
            {{input name='PSPID' type='hidden' field='environment' value='BBPGES'}}
            {{input name='orderID' type='hidden' field='environment' value='EEC202312'}}
            {{input name='amount' type='hidden' field='environment' value='200.50'}}
            {{input name='EMAIL' type='hidden' field='environment' value=$customer.emailaddress}}
         {{/formHash}}  
{{/form}}


Output based on the email address bit-bucket@msdp1.com:
<input value="BBPGES" name="PSPID" type="hidden">
<input value="EEC202312" name="orderID" type="hidden">
<input value="200.50" name="amount" type="hidden">
<input value="bit-bucket@msdp1.com" name="EMAIL" type="hidden">
<input type="hidden" name="SHASign" value="95BB7E108D8B0CC30682B4116C47E48421F7C3D6">