"1001",
"VK_VERSION" => "008",
"VK_SND_ID" => "uid100036",
"VK_STAMP" => "12345",
"VK_AMOUNT" => "150",
"VK_CURR" => "EUR",
"VK_ACC" => "LT424010051001894050",
"VK_NAME" => "BIGBANK AS FILIALAS",
"VK_REF" => "1234561",
"VK_LANG" => "EST",
"VK_MSG" => "Torso Tiger",
"VK_RETURN" => "https://pangalink.indoorsman.ee/project/w1G5TfRBvRolj60F?payment_action=success",
"VK_PANK" => "40100",
"VK_TIME_LIMIT" => "2024-11-21 21:39:57",
);
// STEP 3. Generate data to be signed
// ==================================
// Data to be signed is in the form of XXXYYYYY where XXX is 3 char
// zero padded length of the value and YYY the value itself
$data = str_pad (strlen($fields["VK_SERVICE"]), 3, "0", STR_PAD_LEFT) . $fields["VK_SERVICE"] . /* 1001 */
str_pad (strlen($fields["VK_VERSION"]), 3, "0", STR_PAD_LEFT) . $fields["VK_VERSION"] . /* 008 */
str_pad (strlen($fields["VK_SND_ID"]), 3, "0", STR_PAD_LEFT) . $fields["VK_SND_ID"] . /* uid100036 */
str_pad (strlen($fields["VK_STAMP"]), 3, "0", STR_PAD_LEFT) . $fields["VK_STAMP"] . /* 12345 */
str_pad (strlen($fields["VK_AMOUNT"]), 3, "0", STR_PAD_LEFT) . $fields["VK_AMOUNT"] . /* 150 */
str_pad (strlen($fields["VK_CURR"]), 3, "0", STR_PAD_LEFT) . $fields["VK_CURR"] . /* EUR */
str_pad (strlen($fields["VK_ACC"]), 3, "0", STR_PAD_LEFT) . $fields["VK_ACC"] . /* LT424010051001894050 */
str_pad (strlen($fields["VK_PANK"]), 3, "0", STR_PAD_LEFT) . $fields["VK_PANK"] . /* 40100 */
str_pad (strlen($fields["VK_NAME"]), 3, "0", STR_PAD_LEFT) . $fields["VK_NAME"] . /* BIGBANK AS FILIALAS */
str_pad (strlen($fields["VK_REF"]), 3, "0", STR_PAD_LEFT) . $fields["VK_REF"] . /* 1234561 */
str_pad (strlen($fields["VK_MSG"]), 3, "0", STR_PAD_LEFT) . $fields["VK_MSG"]; /* Torso Tiger */
/* $data = "0041001003008009uid10003600512345003150003EUR020LT42401005100189405000540100019BIGBANK AS FILIALAS0071234561011Torso Tiger"; */
// STEP 4. Sign the data with RSA-SHA1 to generate MAC code
// ========================================================
openssl_sign ($data, $signature, $private_key, OPENSSL_ALGO_SHA1);
/* kg386oshFHUsW4Rd9HCAQ/8plBDwwST/c5t1wsShqUIjP3BI8Qam9smt0/JWTSxnu/fy3hRXzxSc6lN7pFTrMwvzaAO4OM3sDeiw0jDR38myMU0mLA+uMlHM8AkkroEytrlsrcm3w9Fn7VfCEiz0/BizF/ePvg8nkZCgVbfJUbwETyVzUTYFmSfVncuLIQRkO6Y5mB99BBkXRo0m6rCppV8cqqpEhCKq2eTcL+Yb2bUYix+05j98+U49K0rL6advDlsh6zLlhsDzTBHtsrIPndWFTJQ5XDfboShL8yhGE/CwgDFSVx3jIFCNEmtWC/1hKQdBoQ7ArTIZIddHfM+wUA== */
$fields["VK_MAC"] = base64_encode($signature);
// STEP 5. Generate POST form with payment data that will be sent to the bank
// ==========================================================================
?>
Makse teostamise näidisrakendus "DNB LT"