"1001",
"VK_VERSION" => "008",
"VK_SND_ID" => "uid100023",
"VK_STAMP" => "12345",
"VK_AMOUNT" => "150",
"VK_CURR" => "EUR",
"VK_ACC" => "LT167044060007888238",
"VK_NAME" => "BIGBANK AS FILIALAS",
"VK_REF" => "1234561",
"VK_LANG" => "EST",
"VK_MSG" => "Torso Tiger",
"VK_RETURN" => "https://pangalink.indoorsman.ee/project/wmtE7gLyGWAoXBjQ?payment_action=success",
"VK_CANCEL" => "https://pangalink.indoorsman.ee/project/wmtE7gLyGWAoXBjQ?payment_action=reject",
"VK_CHARSET" => "utf-8",
);
// 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"] . /* uid100023 */
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"] . /* LT167044060007888238 */
str_pad (strlen($fields["VK_PANK"]), 3, "0", STR_PAD_LEFT) . $fields["VK_PANK"] . /* */
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 = "0041001003008009uid10002300512345003150003EUR020LT167044060007888238000019BIGBANK AS FILIALAS0071234561011Torso Tiger"; */
// STEP 4. Sign the data with RSA-SHA1 to generate MAC code
// ========================================================
openssl_sign ($data, $signature, $private_key, OPENSSL_ALGO_SHA1);
/* PWlrygenqHAfpCI3Ol5qYNu8+n5wVScEatXNlLg6a6JrR8+EByn9W0XYSWXAo2lyvEhgTORnS5nm9YOG4Hfo2r/8iwqR15z0dTmGChWrgsB0lE4rOdfnEdUNijD+h/4AGW/7YoiV5suwFo2MoOEtoE8FiDqh4ZG5IaQ0xdpFnxQ5wy0ib/4MX0htxwCbD2ZWO7ifYg1/bJDTq7UblFHuDlT23RxiuJPdv5NDoWXSg3zfGQJC/GlrFyyXqjeOxDFQSlgOa6MVdgAz7JnHtWESTsuUse5xLMkjweqUo70+vPw42UFluYi2n/8Dfd8GW6l3WQ8toDIptyvil0bACNvj2g== */
$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 "SEB (old protocol)"