Request

Transaction can be initiated using form POST Request at following gateway URL :

  • For Live Transaction: https://checkout.paykun.com/payment

  • For Test Transaction: https://sandbox.paykun.com/payment

Form should contain three inputs to make this input as hidden to prevent exposure:

Here, encrypted_request is encrypted “||” separated data string, all parameters should first concat using “||” in the following format:

param_1: value_1 || param_2: value_2 || param_3: value_3 || ...

Example :

amount::20;
billing_address::billing_address;
billing_city::billing_city;
billing_country::billing_country;
billing_state::billing_state;
billing_zip::billing_zip;
customer_email::customer_email;
customer_name::customer_name;
customer_phone::customer_phone;
failure_url::failure_url;
order_no::order_no;
product_name::product_name;
shipping_address::shipping_address;
shipping_city::shipping_city;
shipping_country::shipping_country;
shipping_state::shipping_state;
shipping_zip::shipping_zip;
success_url::success_url;
udf_1::any_extra_param_you_want

And then it should be encrypted using the encryption algorithm shown in the following example of a form that can be used:

Example :

encrypt("amount::20;billing_address::billing_address;billing_city::billing_city;billing_country::billing_country;billing_state::billing_state;billing_zip::billing_zip;customer_email::customer_email;customer_name::customer_name;customer_phone::customer_phone;failure_url::failure_url;order_no::order_no;product_name::product_name;shipping_address::shipping_address;shipping_city::shipping_city;shipping_country::shipping_country;shipping_state::shipping_state;shipping_zip::shipping_zip;success_url::success_url;udf_1::any_extra_param_you_want", api_secret)
<html lang="en">

<head>
    <title>Processing Payment...</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"> </head>

<body>
    <div> Processing your payment, please wait... </div>
    <form action="{gateway_url}" method="post" name="server_request" target="_top">
        <table width="80%" align="center" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    <input type="hidden" name="encrypted_request" id="encrypted_request" value="{encrypted_request}" /> </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="merchant_id" id="merchant_id" value="{merchant_id}" /> </td>
            </tr>
            <tr>
                <td>
                    <input type="hidden" name="access_token" id="access_token" value="{access_token}"> </td>
            </tr>
        </table>
    </form>
    <script type="text/javascript">
        document.server_request.submit();
    </script>
</body>

</html>

Last updated