3D Model Payment Completion

To use the 3D Model, a request should be made to the paySmart3D API with the parameter “payment_completed_by” : “merchant”. If the “md_status” : 1 is returned from the paySmart3D API, it indicates that the card has been verified, and the /payment/complete API should be called to withdraw the amount from the card.

If the result is not sent to the API within 15 minutes, it will automatically result in a "Failure."

Processing should be initiated based on the value of md_status from the request received through paySmart3D redirection.

  • md_status = 1 (Card Verified)
  • md_status = 0 (Card Not Verified)

Endpoint, Headers, and Request information are provided below.

Method API Endpoint Content-Type
POST /payment/complete application/json

HASH KEY GENERATION

function generateConfrimPaymentHashKey($merchant_key, $invoice_id, $order_id,  $status, $app_secret)
{

    $data = $merchant_key . '|' . $invoice_id . '|' . $order_id . '|' . $status;

    $iv = substr(sha1(mt_rand()), 0, 16);
    $password = sha1($app_secret);

    $salt = substr(sha1(mt_rand()), 0, 4);
    $saltWithPassword = hash('sha256', $password . $salt);

    $encrypted = openssl_encrypt(
        "$data", 'aes-256-cbc', "$saltWithPassword", null, $iv
    );
    $msg_encrypted_bundle = "$iv:$salt:$encrypted";
    $msg_encrypted_bundle = str_replace('/', '__', $msg_encrypted_bundle);
    return $msg_encrypted_bundle;
}

Examples

{

"merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
"invoice_id": "9a197ed9-cfaf-4456-b0fc-da74a95f461c",
"order_id": "166254527653758",
"status": "complete",
"hash_key": "36a50210c8b2f19e:11629:eHBA0moN..."

}