Голомт Банк
  • E-Commerce
  • WC Payment Plugin
  • IPPOS
  • Instore
  • Card Gateway
  • Instore v2
  • Tokenization
  • Socialpay

›Checksum

E-COMMERCE

  • Танилцуулга
  • Workflow
  • API

    • Ерөнхий
    • Нэхэмжлэх үүсгэх
    • Гүйлгээ шалгах
    • Токен гүйлгээ шалгах
    • Токеноор гүйлгээ хийх
  • Нэхэмжлэх дуудах
  • Push Notification
  • Merchant Redirect
  • Токен үүсгэх
  • Гүйлгээний өндөрлөө хийсэн дэлгэрэнгүй
  • Алдааны коднууд
  • Checksum

    • Тайлбар
    • Samples

E-COMMERCE English

  • Introduction
  • Workflow
  • API

    • General
    • Create an invoice
    • Check transaction
    • Check Token transaction
    • Token transactions
  • Invoice call up
  • Push Notification
  • Merchant Redirect
  • Create a token
  • Details of settlemented transactions
  • Error codes
  • Checksum

    • Definitions
    • Samples

Samples

The key in the sample code is the key preliminary agreed upon between the bank and the merchant, and the message is the value generated according to the given formula or combination of data.

Code

Java
PHP
Node.js
C#
Python
private static String encode(String key, String message) throws Exception {
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256");
sha256_HMAC.init(secret_key);
byte[] hmacArray = sha256_HMAC.doFinal(data.getBytes("UTF-8"));
StringBuilder sb = new StringBuilder(hmacArray.length * 2);
for (byte b : hmacArray)
sb.append(String.format("%02x", b & 0xff));
return sb.toString();
}
function hmac($key, $message){
return hash_hmac('sha256', $message, $key);
}
var crypto = require("crypto");

function hmac256(key, message) {
let hash = crypto.createHmac("sha256", key).update(message);
return hash.digest("hex");
}
private static string HashHMACHex(string key, string message)
{
var encoding = new ASCIIEncoding();
var hash = new HMACSHA256(encoding.GetBytes(key));
return BitConverter.ToString(hash.ComputeHash(encoding.GetBytes(message))).Replace("-", "").ToLower();
}
import hmac
import hashlib

def hmac256(key,message):
digest_maker=hmac.new(key,message, hashlib.sha256)
return digest_maker.hexdigest()
← Definitions
Facebook Open Source
Copyright © 2024 Golomt Bank