generateTransactionStatusHash static method
Generate hash for GET_TRANS_STATUS by payment_id
Formula: SHA1(MD5(UPPERCASE(payment.id + merchant.pass))) Reference: https://docs.mobibox.io/docs/guides/checkout_integration#get-transaction-status-signature-by-payment_id
Implementation
static String generateTransactionStatusHash({
required String paymentId,
required String password,
}) {
// Concatenate: payment.id + merchant.pass
final concatenated = '$paymentId$password';
// Convert to uppercase
final upperCase = concatenated.toUpperCase();
// Calculate MD5 and convert to hex string
final md5Hash = md5.convert(utf8.encode(upperCase));
final md5HexString = md5Hash.toString();
// Calculate SHA1 of the MD5 hex string
final sha1Hash = sha1.convert(utf8.encode(md5HexString));
// Return SHA1 as hex string
return sha1Hash.toString();
}