The Gr8Pay API is organized around SOAP. Our API accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Integration with the Gr8Pay webservices services requires generating a hashed signature.
The SHA256 hash function is used to validate the integrity of the data, for more information on SHA256 see: http://en.wikipedia.org/wiki/SHA256
Your Personal Hash Key is managed in the Merchant Control Panel under Global Settings.
Example with the following values:
CompanyNum = 1234567
TransType = 1
TypeCredit = 1
Amount = 5.4
Currency = 1
CardNum = 4580000000000000
RefTransID = 1234
PersonalHashKey = AU7E468HNF
CompanyNum + TransType + TypeCredit + Amount + Currency + CardNum + RefTransID + PersonalHashKey
“1234567” + “1” + “1” + “5.4” + “1” + “4580000000000000” + “1234” + “AU7E468HNF”
Base64(SHA256(“1234567115.4145800000000000001234AU7E468HNF”))
Result: “PTpzX9OACBC+V3Fd9+TNCehnwIfqMaXmnUtsZMSRyVo=
The following examples show how the signature should be built in various languages.
All examples are using the string “1234567ABCDEFGHIJ” as input.
The correct output with URLEncoded is “yZo3as0hwZMOO%2bVO0sTXSg%3d%3d”.
The correct output without URLEncoded is “yZo3as0hwZMOO+VO0sTXSg==”.
1 2 3 4 5 6 7 8 9 10 | Public Class Signature Public Shared Function GenerateSHA256(ByVal value As String) As String Dim sh As System.Security.Cryptography.SHA256 = System.Security.Cryptography.SHA256.Create() Dim hashValue As Byte() = sh.ComputeHash(System.Text.Encoding.UTF8.GetBytes(value)) Return System.Convert.ToBase64String(hashValue) End Function End Class ‘Usage Example Dim sSignature As String = Signature.GenerateSHA256(“1234567ABCDEFGHIJ”) |
1 2 3 4 5 6 7 8 9 10 11 12 | public class Signature { public static string GenerateSHA256(string value) { System.Security.Cryptography.SHA256 sh = System.Security.Cryptography.SHA256.Create(); byte[] hashValue = sh.ComputeHash(System.Text.Encoding.UTF8.GetBytes(value)); return System.Convert.ToBase64String(hashValue); } } //Usage Example string sSignature = Signature.GenerateSHA256(“1234567ABCDEFGHIJ”); |
1 2 | $val=base64_encode(hash(“sha256”, “1234567ABCDEFGHIJ”, true)); |
Integration with the Gr8Pay webservices services requires generating a hashed signature.
The SHA256 hash function is used to validate the integrity of the data, for more information on SHA256 see: http://en.wikipedia.org/wiki/SHA256
Your personal hash key is managed in the merchant control panel under global settings or within the edit client page in your Pay2Code account.
Example with the following values:
CompanyNum = 1234567
TransType = 1
TypeCredit = 1
Amount = 5.4
Currency = 1
CardNum = 4580000000000000
RefTransID = 1234
PersonalHashKey = AU7E468HNF
CompanyNum + TransType + TypeCredit + Amount + Currency + CardNum + RefTransID + PersonalHashKey
“1234567” + “1” + “1” + “5.4” + “1” + “4580000000000000” + “1234” + “AU7E468HNF”
Base64(SHA256(“1234567115.4145800000000000001234AU7E468HNF”))
Result: “PTpzX9OACBC+V3Fd9+TNCehnwIfqMaXmnUtsZMSRyVo=
The following examples show how the signature should be built in various languages.
All examples are using the string “1234567ABCDEFGHIJ” as input.
The correct output with URLEncoded is “yZo3as0hwZMOO%2bVO0sTXSg%3d%3d”.
The correct output without URLEncoded is “yZo3as0hwZMOO+VO0sTXSg==”.
1 2 3 4 5 6 7 8 9 10 | Public Class Signature Public Shared Function GenerateSHA256(ByVal value As String) As String Dim sh As System.Security.Cryptography.SHA256 = System.Security.Cryptography.SHA256.Create() Dim hashValue As Byte() = sh.ComputeHash(System.Text.Encoding.UTF8.GetBytes(value)) Return System.Convert.ToBase64String(hashValue) End Function End Class ‘Usage Example Dim sSignature As String = Signature.GenerateSHA256(“1234567ABCDEFGHIJ”) |
1 2 3 4 5 6 7 8 9 10 11 12 | public class Signature { public static string GenerateSHA256(string value) { System.Security.Cryptography.SHA256 sh = System.Security.Cryptography.SHA256.Create(); byte[] hashValue = sh.ComputeHash(System.Text.Encoding.UTF8.GetBytes(value)); return System.Convert.ToBase64String(hashValue); } } //Usage Example string sSignature = Signature.GenerateSHA256(“1234567ABCDEFGHIJ”); |
1 2 | $val=base64_encode(hash(“sha256”, “1234567ABCDEFGHIJ”, true)); |