Hashing

Some endpoints require a digital signature Hash to be sent with the body payload. This digital signature is used to verify and guarantee the authenticity of the request.

Hash is SHA1 hashing of body payload parameters and your Gameball account secret transactionKey. When Gameball receives a request with hashing, it computes the Hash value and compares it against the one sent with the request. If the two hashes match then the request processed, otherwise it will be rejected.

Hash is computed according to the below algorithm. Variables found in this algorithm must be equal to their equivalent values in the request payload.

Hashing for Transactions APIs

Below is the description of the required hashing as required for transactions APIs. For Transactions List API use Hashing for Transactions List​

Hash =
sha1.ComputeHash(PlayerUniqueId+":"+yyMMddHHmmss+":"+
Amount+":"+transactionkey)

Variable

Value

playerUniqueId

playerUniqueIdas sent in the request payload

yyMMddHHmmss

This is extracted from the request payload parameter transaction time without any separator.

Time must be 24 format. For example: 200430163519

Amount

Amountas sent in the request payload. Amount value can be the value of points if used in Manual transaction case

transactionKey

Gameball account client salt key.

For request that have no Amount or transaction time parameters. They are substituted in the algorithm by empty string. Below is an example showing the hashing of a request with no Amount.

Hash =
sha1.ComputeHash(PlayerUniqueId+":"+yyMMddHHmmss+":"+
""+":"+transactionkey)

Note: In case Amount value is 0, it is sent with a value of 0, not as an empty string.

Hashing for Transactions List

Variable

Value

transactionId

​

transactionKey

Gameball account client salt key.

Hash =
sha1.ComputeHash(transactionId+":"+transactionkey)