1. Register in the Qazeek system
2. Activate the merchant in the Merchant Portal tab by going to the Add Store button and filling in the following fields:
Name: the name of your website, e.g. “Google”. This name will be displayed on your merchant list and the user’s list when paying an invoice.
Domain : your website’s domain name, e.g. “google.com”. The domain name can only contain Latin letters, numbers, and hyphens. To convert national domain names, use any punycode converter such as punycoder.
IPN (Postback) URL : you can get this from code integeration.
3. Your API Key and Api Secret will be Automatically Generated.
Qazeek is used as the syntax highlighter here.
<form method="post" action="https://qazeek.com/pay">
<input type="hidden" name="amount" value="11.00" />
<input type="hidden" name="currency" value="USD" />
<input type="hidden" name="store_id" value="1" />
<input type="hidden" name="store_key" value="ashdkjashdjhjh" />
<input type="hidden" name="business_email" value="[email protected]" />
<input type="hidden" name="invoice_id" value="1234" />
<input type="hidden" name="customer_id" value="12" />
<input type="hidden" name="description" value="Invoice for website" />
<input type="hidden" name="success_url" value="http://7tracking.com/form.php?success_url" />
<input type="hidden" name="cancel_url" value="http://7tracking.com/form.php?cancel_url" />
<input type="hidden" name="cmd" value="_pay">
<input type="submit" value="Pay with Qazeek">
</form>
Variable | Required | Description |
---|---|---|
amount | Required | Amount of the transaction which will be debited from user account |
currency | Required | Currency Symbol of the Amount of the transaction |
store_id | Required | The Store ID when you create the store you can see on that page |
store_key | Required | The Store API Key when you create the store you can see on that page |
business_email | Required | Your account email from which the merchant store is created |
invoice_id | Optional | The Invoice ID on your side when the postback is called, we will send you. |
customer_id | Optional | The Customer ID on your side when the postback is called, we will send you. |
description | Required | The Invoice Description for which the payment will be made. |
success_url | Optional | If the transaction go through successfully the user wll be sent to this URI. URI must start with http |
cancel_url | Optional | If the transaction didn't go through successfully the user wll be sent to this URI. URI must start with http |
cmd | Required | This is the system command its value for simple merchant payment will be "_pay" |
The following variables will be sent to IPN URI provided via POST in settings only when the transaction is made successfully.
Variable | Description |
---|---|
amount | Amount of the transaction which is made |
currency | Currency Symbol of the Amount of the transaction |
invoice_id | The Invoice ID which is passed by you when making transaction otherwie it will be empty. |
customer_id | The Customer ID which is passed by you when making transaction otherwie it will be empty. |
txn_id | The TXN ID of the Qazeek. |
store_name | The Store name of the merchant store in Qazeek. |
<php
$ip = $_SERVER['REMOTE_ADDR'];
if(in_array($ip, array('192.254.71.212'))) {
$amount = $_POST['amount']; //amount of the transaction
$currency = $_POST['currency']; //currency of the transaction
$customer_id = $_POST['customer_id']; //optional variable which is passed by merchant
$invoice_id = $_POST['invoice_id']; //optional variable which is passed by merchant
$txn_id = $_POST['txn_id']; //Qazeek system transaction id which you can see in your account
$store_name = $_POST['store_name']; //Your website registered name on Qazeek
$order = $db->query("select * from orders where id = $invoice_id");
if($order['amount'] == $amount) {
//you can also perform your query direct here or for double check you can perform following code
$ch = curl_init();
$api_key = "********"; //api key in your store area
$api_secret = "********"; //api secret at time of creating store
$business_email = "[email protected]"; //your account email
$parameters = array('api_key' => $api_key, 'api_secret' => $api_secret, 'email' => $business_email, 'txn_id' => $txn_id);
$parameters = http_build_query($parameters);
curl_setopt($ch, CURLOPT_URL,"https://qazeek.com/verify");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch); //executing curl request
curl_close ($ch);
//decoding received json
$data = json_decode($server_output, true);
if($data['result'] == true || $data['result'] == "true") {
$amount = $data['amount']; //amount received of transaction
$currency = $data['currency']; //currency code of the transaction
$txn_id = $data['txn_id']; //TXN Id of payment
$txn_fee = $data['txn_fee']; //TXN fee on Qazeek
$amount_received = $data['amount_received']; //amount received in merchant account
$invoice_id = $data['invoice_id']; //optional variable which is passed by merchant
$customer_id = $data['customer_id']; //optional variable which is passed by merchant
$customer_name = $data['customer_name']; //customer name from which the payment is made
$customer_email = $data['customer_email']; //customer email from which the payment is made
if($order['amount'] == $amount) {
//process your database
$db->query("update orders set payment_status = 1 where customer_id = '{$customer_id}' and id = '{$invoice_id}'");
echo "ok";
}
} else {
die($data['message']);
}
}
}
?>
>>> x = int(input("
Please enter an integer: ")) Please enter an integer: 42
>>> if x < 0:
... x = 0
... print('Negative changed to zero')
... elif x == 0:
... print('Zero')
... elif x == 1:
... print('Single')
... else:
... print('More')
... More