Appendix A
Hash formulas
The hash field is the signature that Payment Platform uses to validate requests from your system, and that your system uses to validate callbacks from Payment Platform. Calculate the hash value with MD5 using the per-action formulas below.
SHA256 hash mode
By default, the hash is calculated with the MD5 algorithm as shown in the formulas below. If the Use SHA256 encryption algorithm for hash option is enabled in the admin panel (Configuration → Protocol Mapping) for your protocol mapping, the hash of your requests is validated with SHA256, and the callbacks you receive are signed with SHA256 instead of the default MD5-based hash. In that case, calculate every formula below with sha256 in place of md5.
Worked SALE signature example for both modes:
// default (MD5):
md5(strtoupper(strrev(email).PASSWORD.strrev(substr(card_number,0,6).substr(card_number,-4))))
// "Use SHA256 encryption algorithm for hash" enabled:
sha256(strtoupper(strrev(email).PASSWORD.strrev(substr(card_number,0,6).substr(card_number,-4))))
Contact your administrator or account manager to confirm which mode is configured for your account.
Formula 1:
hash for SALE, RETRY is calculated by the formula:
md5(strtoupper(strrev(email).PASSWORD.strrev(substr(card_number,0,6).substr(card_number,-4))))
⚠️ Pay attention
If the formula contains optional parameters that you do not send in the request (for example,
payer_emailin the DEBIT request), please ignore that parameter for the hash.
if parameter card_token is specified hash is calculated by the formula:
md5(strtoupper(strrev(email).PASSWORD.strrev(card_token)))
hash for RECURRING_SALE is calculated by the formula:
md5(strtoupper(strrev(email).PASSWORD.strrev(substr(card_number,0,6).substr(card_number,-4))))
Formula 2:
hash is calculated by the formula:
md5(strtoupper(strrev(email).PASSWORD.trans_id.strrev(substr(card_number,0,6).substr(card_number,-4))))
Formula 3:
hash for Create a schedule is calculated by the formula:
md5(strtoupper(strrev(PASSWORD)))
Formula 4:
hash for Other schedules is calculated by the formula:
md5(strtoupper(strrev(schedule_id + PASSWORD)))
Formula 5:
hash for CREDIT2CARD request is calculated by the formula:
md5(strtoupper(PASSWORD.strrev(substr(card_number,0,6).substr(card_number,-4))))
if card_token is specified hash is calculated by the formula:
md5(strtoupper(PASSWORD. strrev(card_token)))
Formula 6:
hash is calculated by the formula:
md5(strtoupper(PASSWORD.trans_id.strrev(substr(card_number,0,6).substr(card_number,-4))))
Formula 7:
hash is calculated by the formula:
md5(strtoupper(strrev(email).PASSWORD.order_id.strrev(substr(card_number,0,6).substr(card_number,-4))))
Formula 8:
hash is calculated by the formula:
md5(strtoupper(strrev(email).PASSWORD))
See also
For related S2S Card documentation, see the following pages:
- S2S Card overview: integration overview and action list.
- Payment operation types: per-action request and response shapes. The CREDIT2CARD request uses Formula 5 and Formula 6.
- Appendix B: worked request and response examples.
- Appendix C: additional parameters for digital wallets and alternative methods.