Hash Üretimi

ApiKey, PublicKey, RND, Oid, Amount ve Currency değerleri sırasıyla uç uca eklenerek string oluşturulur. Oluşturulan string'in SHA512 algoritması ile SecretKey ile Byte hash'i alınır ve oluşturulan byte hash base64 encode edilerek hash değeri oluşturulur.

Örnek .Net Hash Fonksiyonu:

Kopyalandı!

              private string CreateHash()
              {
              string apiKey = "3F76D2BA-074F-4A83-989F-7AF1FBFC93E1";
              string publicKey =
              "39308144DD24F47DD3C7ECFB8E54CC41BE4CF43BD1E8167D35398D769A3277B8";
              string secretKey =
              "D7452D50390715218654C1D6CBF0E740B030618E098D9D04ED3176E0360C655F";
              string rnd = DateTime.Now.Ticks.ToString();
              string oid = "0123456789101112131415";
              string amount = "100,56";
              string currency = "1";
              string hashString = string.Concat(apiKey,
              publicKey, rnd, oid, amount, currency);
              HMACSHA512 hmac = new
              HMACSHA512(Encoding.UTF8.GetBytes(secretKey));
              byte[] b =
              hmac.ComputeHash(Encoding.UTF8.GetBytes(hashStri
              ng));
              string hash = Convert.ToBase64String(b);
              return hash;
              }