Introduction

This section describes the Sinek Payment payment gateway API.


Sinek Payment API documentation is easy to implement in your principle domain. This API will be used for payment via payment domain to supported gateways.

Supported Currencies

This section describes the currencies supported by Sinek Payment


Sinek Payment allows to make transaction with below currencies. Any new currency may update in future.

Currency Name Currency Symbol Currency Code
United States Dollar $ USD
The euro EUR
The Australian Dollar A$ AUD
Canadian Dollar C$ CAD
Brazilian Real R$ BRL
Hong Kong dollar HKD
Bangladesh taka BDT

Get The Secret Key

This section describes how can you get the secret key.


Login to your Sinek Payment account.

Go to Plans > My Plan and click the more button thann click to secret key option

The secret key can be found there. Use that key to initiate the API request. Anytime you can generate new API key by clicking re-generate.

Initiate Payment

This section describes the process of initiating the payment.


To initiate the payment follow the example code and be careful with the parameters. You will need to make request with your payment domain url.

End Point: {{yourpaymentdomain.com}}/api/payment/initiate

Request Method: POST

Request to the end point with the following parameters below.

Param Name Param Type Description
amount * numeric The amount which will be paid
currency * string Supported currency of Sinek Payment. Make sure you've setup the currency to your gateway.
details * string Some text for remark
custom * string An identification text. It will be return the IPN
ipn_url * string The url of instant payment notification.
failed_url * string User will be redirected to this url after the payment failed.
redirect_url * string User will be redirected to this url after the payment success.
name * string User's full name.
email * string User's email.
alias * string The supported gateway Sinek Payment. The alias should be Paypal or Stripe

In the successful response you'll get a redirect_url or iframe_url. If you get the redirect_url, just redirect to this url, else follow the iframe section instruction.

Example PHP code

<?php

$parameters = [
    'amount' => 50,
    'currency' => 'USD',
    'details' => 'Payment description',
    'custom' => 'DFU80XZIKS',
    'ipn_url' => 'http://example.com/ipn_url.php',
    'redirect_url' => 'http://example.com/redirect_url.php',
    'failed_url' => 'http://example.com/failed_url.php',
    'email' => 'john@doe.com',
    'alias' => 'Stripe',
    'firstname'    => 'John',
    'lastname'     => 'Doe',
    'company'      => 'Company Name',
    'address'      => 'User Address',
    'city'         => 'User City',
    'state'        => 'User State',
    'zip'          => 'User Zip',
    'country'      => 'User Country',
];

$url = '{{yourpaymentdomain.com}}/api/payment/initiate';

$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS,  $parameters);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

$result = json_decode($result);

//$result contains the response back.
?>
Example Responses

//Error Response.
{
    "remark":"validation_error",
    "status":"error",
    "message":{
        "error":[
            "The amount field is required.",
            "The currency field is required."
        ]
    },
    "data":[]
}

//Success Response.
{
    "remark":"initiated",
    "status":"success",
    "message":{
        "success":[
            "Payment initiated."
        ]
    },
    "data":{
        //If iframe_url is not present
        "redirect_url":"https://checkout.stripe.com/pay/cs_test_a1D9jPA1IhDT34i6cN8jB7Ilsroug6FTkwrVMn6vAGhH6CcoX9iyYnYmXO#fidkdWxOYHwnPyd1blpxYHZxWjA0SU1VZFBPN3FCQjJdbzMwXFV0ZFBcQmdDRkZKREJ1fG1kU0FRQktmdFJtZzdgTn1EfElIUGJfdUloPUtHVDViTkBdSEBVcTQ3PDw3SEthfVF%2Fc0c8cGhkNTUzdEtpQWBrVycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl"

        //If redirect_url is not present
        "iframe_url":"{{yourpaymentdomain.com}}/payment-authorize-gateway?trx=eyJpdiI6ImpMb2VkOWQwQUJLcHhaWDE3K01RbUE9PSIsInZhbHVlIjoiQjBaTjFSZForRHhLNXRndy9jRW9zUVlGTk1SL242VDg2b0lPVmdEUFU0dz0iLCJtYWMiOiJlOTU5ZTFkNDEzMjU2ZmY2ZWZlN2U5ZGRjNTNiNWQwNTQwNmRiYmNhZDM2MDVlNzlmNmM2NDUxNzQ2MzY2ZWRmIiwidGFnIjoiIn0="
    }
}

Iframe Instruction


If you're paying with NMI gateway or Authorize.net, you didn't get any redirect URL. You'll get an iframe url which you've to put in iframe HTML tag. In this iframe payer will see the input fields for putting the credit card information. After submission it will be redirect to a success or failed url

Your success and failed URL should execute some HTML code. Those HTML codes will be used to close the iframe

Example Iframe
<iframe src="yourpaymentdomain.com/payment-authorize-gateway?trx=eyJpdiI6ImpMb2VkOWQwQUJLcHhaWDE3K01RbUE9PSIsInZhbHVlIjoiQjBaTjFSZForRHhLNXRndy9jRW9zUVlGTk1SL242VDg2b0lPVmdEUFU0dz0iLCJtYWMiOiJlOTU5ZTFkNDEzMjU2ZmY2ZWZlN2U5ZGRjNTNiNWQwNTQwNmRiYmNhZDM2MDVlNzlmNmM2NDUxNzQ2MzY2ZWRmIiwidGFnIjoiIn0=" height="500" width="720" frameborder="0"></iframe>
Example Success or Failed Page
<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
    </head>
    <body>
        <h4>The payment is successfully captured. You will redirect soon...</h4>
        <script>
            setInterval(() => {
                window.parent.location.href = "yourpaymentdomain.com"; 
            }, 2000);
        </script>
    </body>
    </html>

Validate The Payment and IPN

This section describes the process to get your instant payment notification.


To validate the payment follow the example code and be careful with the parameters.

You will get following parameters below.

Param Name Description
custom custom is basically for identify payment at your end.
signature A hash signature to verify your payment at your end.
amount The amount which have paid.
currency The currency of paid amount.
trx Transaction number of the transaction.
Example PHP code

<?php
    //Receive the response parameter
    $signature = $_POST['signature'];
    $custom = $_POST['custom'];
    $trx = $_POST['trx'];
    $amount = $_POST['amount'];
    $currency = $_POST['currency'];

    // Generate your signature
    $customKey = $amount.$currency.$custom.$trx;
    $secret = 'YOUR_SECRET_KEY';
    $mySignature = strtoupper(hash_hmac('sha256', $customKey , $secret));

    $myCustom = 'YOUR_GIVEN_CUSTOM_TEXT';

    if($signature == $mySignature &&  $custom ==  $myCustom){
        //your operation logic
    }
?>

API Plugin


You can use our ready made API Plugin for your desire CMS to collect payment using sinek.

WooCommerce Plugin

We may use cookies or any other tracking technologies when you visit our website, including any other media form, mobile website, or mobile application related or connected to help customize the Site and improve your experience. learn more

Allow