Direct Integrationservice allows different Merchant to integrate with Bitaqaty Business to let Customers Buy product using their Bitaqaty Business account balance
Bitaqaty Business system offers online shopping to merchants in order to expand their current payment processing options by adding Bitaqaty Business as a payment method where Bitaqaty Business user will select Bitaqaty Business as the payment method on the shopping interface of the website, and will be redirected to Bitaqaty Business’s website in order to provide his Bitaqaty Business credentials. Once the credentials are verified, the user will be redirected to the merchant’s website back to get the service.
MD5 (OneCard_MerchID + OneCard_Code + OneCard_TransID + OneCard_Amount + OneCard_Currency + OneCard_RTime + OneCard_TransKey)
This is consider main method of this service where Customer finishes their shopping on the merchant site and proceeds to merchant’s checkout page then Merchant redirects customer to Bitaqaty Business staging or Production Integration URL as mention below via http post request with the appropriate request parameters that includesmerchant signature.
Environment | URL | Method |
---|---|---|
Staging | https://www.ocstaging.net/mobile/integratedPayment.html | |
Production | https://www.netader.com/mobile/integratedPayment.html |
Environment | URL | Method |
---|---|---|
Staging | https://www.ocstaging.net/customer/integratedPayment.html | |
Production | https://www.netader.com/customer/integratedPayment.html |
Parameter Name | Data Type | Description | Validation |
---|---|---|---|
OneCard_Code | Long | Response codes, refer to Response Codes | 2 digits |
OneCard_TransID | String, alphanumeric | Transaction identifier generated by the merchant | Unique |
OneCard_Amount | Double | The price of product/service provided by merchant that will be deducted from Bitaqaty Business’s user balance | Greater than zero |
OneCard_Currency | String | Currency (Please check Bitaqaty Business website for the supported currencies) http://www.netader.com/customer/currencyList.html |
3 letter ISO currency code |
OneCard_RTime | Long | Bitaqaty Business timestamp which represents milliseconds passed from 0:00:00 01.01.1970 in GMT till the time of your request, no business logic are implemented on this parameter | 13 digits |
OneCard_Description | String | Returned code description | ........ |
OneCard_Field1 | String | Extra field; can be used by merchant to identify the transaction | Optional, maximum 50 chars |
OneCard_Field2 | String | Additional extra field; can be used by merchant to identify the transaction | Optional, maximum 50 chars |
OneCard_RHashKey | MD5 Hash | MD5 digest for a string, composed as follows in order:
MD5 (OneCard_MerchID + OneCard_TransID + OneCard_Amount + OneCard_Currency + OneCard_RTime + OneCard_Keyword + OneCard_Code) |
const Url='https://www.ocstaging.net/mobile/integratedPayment.html';
const data ={
'OneCard_MerchID' : 'testingg',
'OneCard_TransID' : '2143688488',
'OneCard_Amount' : '10',
'OneCard_Currency' : 'SAR',
'OneCard_Timein' : 1533785391,
'OneCard_MProd' : 'Dummy product',
'OneCard_ReturnURL' : 'index.html',
'OneCard_Field1' : 'Dummy data',
'OneCard_Field2' : 'Dummy data',
'OneCard_HashKey' : 'b21bee1d13107ae48623411762768fc9',
'OneCard_CancelURL' : 'index.html',
'siteLanguage' : 'EN'
}
$('.btn').click(function(){
$.post(Url,data,function(data,status){
console.log('S{data} and status is ${status}')
});
});
import urllib, urllib2
url = 'https://www.ocstaging.net/mobile/integratedPayment.html'
values = {
'OneCard_MerchID' : 'testingg',
'OneCard_TransID' : '2143688488',
'OneCard_Amount' : '10',
'OneCard_Currency' : 'SAR',
'OneCard_Timein' : 1533785391,
'OneCard_MProd' : 'Dummy product',
'OneCard_ReturnURL' : 'index.html',
'OneCard_Field1' : 'Dummy data',
'OneCard_Field2' : 'Dummy data',
'OneCard_HashKey' : 'b21bee1d13107ae48623411762768fc9',
'OneCard_CancelURL' : 'index.html',
'siteLanguage' : 'EN'
}
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
rsp = urllib2.urlopen(req, timeout=60)
content = rsp.read()
print content
<?php
$url = 'https://www.ocstaging.net/mobile/integratedPayment.html';
$params = array(
'OneCard_MerchID' => 'testingg',
'OneCard_TransID' => '2143688488',
'OneCard_Amount' => '10',
'OneCard_Currency' => 'SAR',
'OneCard_Timein' => 1533785391,
'OneCard_MProd' => 'Dummy product',
'OneCard_ReturnURL' => 'index.html',
'OneCard_Field1' => 'Dummy data',
'OneCard_Field2' => 'Dummy data',
'OneCard_HashKey' => 'b21bee1d13107ae48623411762768fc9',
'OneCard_CancelURL' => 'index.html',
'siteLanguage' => 'EN'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
// This should be the default Content-type for POST requests
//curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/x-www-form-urlencoded"));
$result = curl_exec($ch);
if(curl_errno($ch) !== 0) {
error_log('cURL error when connecting to ' . $url . ': ' . curl_error($ch));
}
curl_close($ch);
print_r($result);
?>
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class JavaPostRequest {
private static HttpURLConnection con;
public static void main(String[] args) throws MalformedURLException,
ProtocolException, IOException {
String url = "https://www.ocstaging.net/mobile/integratedPayment.html";
String urlParameters = "OneCard_MerchID=testingg+&OneCard_TransID=2143688488+&OneCard_Amount=10&OneCard_Currency=SAR+&OneCard_Timein=1533785391+&OneCard_MProd=Citroen&OneCard_ReturnURL=Sucess_page.php+&OneCard_Field1=Dummy+data+&OneCard_Field2=Dummy+data+&OneCard_HashKey=b21bee1d13107ae48623411762768fc9&OneCard_CancelURL=index.php+&siteLanguage=Ar+
";
byte[] postData = urlParameters.getBytes(StandardCharsets.UTF_8);
try {
URL myurl = new URL(url);
con = (HttpURLConnection) myurl.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", "Java client");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
try (DataOutputStream wr = new DataOutputStream(con.getOutputStream())) {
wr.write(postData);
}
StringBuilder content;
try (BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()))) {
String line;
content = new StringBuilder();
while ((line = in.readLine()) != null) {
content.append(line);
content.append(System.lineSeparator());
}
}
System.out.println(content.toString());
} finally {
con.disconnect();
}
}
}
On a separate call Bitaqaty Business sends a different http request to merchant’s handshake URL then Merchant validates Bitaqaty Business request; i.e. calculate the proper hash code value and compare it with the one passed by Bitaqaty Business and after This Merchant replies back with a confirmation response to Bitaqaty Business request via the response of Bitaqaty Business request. The response should include only a hash key value that calculates as follows:
MD5 (OneCard_MerchID + OneCard_Code + OneCard_TransID + OneCard_Amount + OneCard_Currency + OneCard_RTime + OneCard_TransKey)
after Send HashKey Bitaqaty Business validates merchant confirmation; i.e. calculate the proper hash code value and compares it with the one passed by the merchant.Environment | URL | Method |
---|---|---|
Staging | previously submitted upon signing the contract | POST |
Production | previously submitted upon signing the contract | POST |
Merchant can request the status of certain transaction from Bitaqaty Business system via a separate http post request
Environment | URL | Method |
---|---|---|
Staging | https://www.ocstaging.net/remote/paymentIntegrationQuery.html | POST |
Production | https://www.netader.com/remote/paymentIntegrationQuery.html | POST |
Parameter Name | Data Type | Description | Validation |
---|---|---|---|
OneCard_MerchID | String | The merchant identifier provided by Bitaqaty Business upon signing the contract | Mandatory |
OneCard_TransID | String,alphanumeric | Transaction identifier generated by the merchant | Mandatory and unique |
OneCard_HashKey | MD5 Hash | MD5 digest for a string, composed as follows in order:
MD5 (OneCard_MerchID + OneCard_TransID + OneCard_TransKey) |
Mandatory |
Parameter Name | Data Type | Description | Validation |
---|---|---|---|
STATUS_CODE | String | Status Code, refer to Response Codes | |
STATUS_MESSAGE | String | Status Message for requested transaction | |
COUNTRY_NAME | String | Customer’s countryname (displayed in case of success only) | |
CUSTOMER_ACCOUNT_NUMBER | String | Customer’s account number (displayed in case of success only) | |
HASH_KEY | MD5 Hash | MD5 digest for a string, composed as follows in order:
MD5 (OneCard_MerchID + OneCard_TransID + STATUS_CODE + STATUS_MESSAGE + OneCard_keyword) |
const Url='https://www.ocstaging.net/remote/paymentIntegrationQuery.html';
const data ={
'OneCard_MerchID' : 'testingg',
'OneCard_TransID' : '2143688488',
'OneCard_HashKey' : 'b21bee1d13107ae48623411762768fc9'
}
$('.btn').click(function(){
$.post(Url,data,function(data,status){
console.log('S{data} and status is ${status}')
});
});
import urllib, urllib2
url = 'https://www.ocstaging.net/remote/paymentIntegrationQuery.html'
values = {
'OneCard_MerchID' : 'testingg',
'OneCard_TransID' : '2143688488',
'OneCard_HashKey' : 'b21bee1d13107ae48623411762768fc9'
}
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
rsp = urllib2.urlopen(req, timeout=60)
content = rsp.read()
print content
<?php
$url = 'https://www.ocstaging.net/mobile/integratedPayment.html';
$params = array(
'OneCard_MerchID' => 'testingg',
'OneCard_TransID' => '2143688488',,
'OneCard_HashKey' => 'b21bee1d13107ae48623411762768fc9',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
// This should be the default Content-type for POST requests
//curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/x-www-form-urlencoded"));
$result = curl_exec($ch);
if(curl_errno($ch) !== 0) {
error_log('cURL error when connecting to ' . $url . ': ' . curl_error($ch));
}
curl_close($ch);
print_r($result);
?>
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class JavaPostRequest {
private static HttpURLConnection con;
public static void main(String[] args) throws MalformedURLException,
ProtocolException, IOException {
String url = "https://www.ocstaging.net/mobile/integratedPayment.html";
String urlParameters = "OneCard_MerchID=testingg&OneCard_TransID=2143688488&OneCard_HashKey=b21bee1d13107ae48623411762768fc9";
byte[] postData = urlParameters.getBytes(StandardCharsets.UTF_8);
try {
URL myurl = new URL(url);
con = (HttpURLConnection) myurl.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", "Java client");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
try (DataOutputStream wr = new DataOutputStream(con.getOutputStream())) {
wr.write(postData);
}
StringBuilder content;
try (BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()))) {
String line;
content = new StringBuilder();
while ((line = in.readLine()) != null) {
content.append(line);
content.append(System.lineSeparator());
}
}
System.out.println(content.toString());
} finally {
con.disconnect();
}
}
}
Merchant can request cancel of certain transaction from Bitaqaty Business system via a separate http post
Environment | URL | Method |
---|---|---|
Staging | https://www.ocstaging.net/remote/cancelIntegrationTransaction.html | POST |
Production | https://www.netader.com/remote/cancelIntegrationTransaction.html | POST |
Parameter Name | Data Type | Description | Validation |
---|---|---|---|
OneCard_MerchID | String | The merchant identifier provided by Bitaqaty Business upon signing the contract | Mandatory |
OneCard_TransID | String,alphanumeric | Transaction identifier generated by the merchant | Mandatory and unique |
OneCard_CancelReason | StringLimit 20-200 | Cancel Reason generated by the merchant | Mandatory and unique |
OneCard_HashKey | MD5 Hash | MD5 digest for a string, composed as follows in order:
MD5 (OneCard_MerchID + OneCard_CancelReason + OneCard_TransID + OneCard_TransKey) |
Mandatory |
Parameter Name | Data Type | Description | Validation |
---|---|---|---|
STATUS_CODE | String | Status Code, refer to Response Codes | |
STATUS_MESSAGE | String | Status Message for requested transaction | |
HASH_KEY | MD5 Hash | MD5 digest for a string, composed as follows in order:
MD5 (OneCard_MerchID + OneCard_TransID + OneCard_CancelReason + STATUS_CODE + STATUS_MESSAGE + OneCard_keyword) |
const Url='https://www.ocstaging.net/remote/cancelIntegrationTransaction.html';
const data ={
'OneCard_MerchID' : 'testingg',
'OneCard_TransID' : '2143688488',
'OneCard_CancelReason' : 'any reason you want',
'OneCard_HashKey' : 'b21bee1d13107ae48623411762768fc9'
}
$('.btn').click(function(){
$.post(Url,data,function(data,status){
console.log('S{data} and status is ${status}')
});
});
import urllib, urllib2
url = 'https://www.ocstaging.net/remote/cancelIntegrationTransaction.html'
values = {
'OneCard_MerchID' : 'testingg',
'OneCard_TransID' : '2143688488',
'OneCard_CancelReason' : 'any reason you want',
'OneCard_HashKey' : 'b21bee1d13107ae48623411762768fc9'
}
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
rsp = urllib2.urlopen(req, timeout=60)
content = rsp.read()
print content
<?php
$url = 'https://www.ocstaging.net/remote/cancelIntegrationTransaction.html';
$params = array(
'OneCard_MerchID' => 'testingg',
'OneCard_TransID' => '2143688488',
'OneCard_CancelReason' : 'any reason you want',
'OneCard_HashKey' => 'b21bee1d13107ae48623411762768fc9',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
// This should be the default Content-type for POST requests
//curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/x-www-form-urlencoded"));
$result = curl_exec($ch);
if(curl_errno($ch) !== 0) {
error_log('cURL error when connecting to ' . $url . ': ' . curl_error($ch));
}
curl_close($ch);
print_r($result);
?>
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class JavaPostRequest {
private static HttpURLConnection con;
public static void main(String[] args) throws MalformedURLException,
ProtocolException, IOException {
String url = "https://www.ocstaging.net/remote/cancelIntegrationTransaction.html";
String urlParameters = "OneCard_MerchID=testingg&OneCard_TransID=2143688488&OneCard_CancelReason=any reason you want&OneCard_HashKey=b21bee1d13107ae48623411762768fc9";
byte[] postData = urlParameters.getBytes(StandardCharsets.UTF_8);
try {
URL myurl = new URL(url);
con = (HttpURLConnection) myurl.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", "Java client");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
try (DataOutputStream wr = new DataOutputStream(con.getOutputStream())) {
wr.write(postData);
}
StringBuilder content;
try (BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()))) {
String line;
content = new StringBuilder();
while ((line = in.readLine()) != null) {
content.append(line);
content.append(System.lineSeparator());
}
}
System.out.println(content.toString());
} finally {
con.disconnect();
}
}
}
Environment | URL |
---|---|
Staging | https://www.ocstaging.net/sec/immLogin.html |
Production | https://www.netader.com/sec/immLogin.html |
Response | Description |
---|---|
00 | VALID_REQUEST |
18 | VALID_TEST_REQUEST |
Response | Description |
---|---|
301 | MISSED_MERCHANT_ID |
302 | MISSED_PRODUCT |
303 | MISSED_AMOUNT |
304 | MISSED_RETURN_URL |
305 | MISSED_CURRENCY |
306 | MISSED_HASHCODE |
307 | MISSED_TRANSACTION_ID |
801 | QUERY_SERVICE_MISSED_MERCHANT_ID |
802 | QUERY_SERVICE_MISSED_TRANSACTION_ID |
803 | QUERY_SERVICE_MISSED_HASHKEY |
901 | CANCEL_SERVICE_MISSED_MERCHANT_ID |
902 | CANCEL_SERVICE_MISSED_TRANSACTION_ID |
903 | CANCEL_SERVICE_MISSED_CANCEL_REASON |
904 | CANCEL_SERVICE_MISSED_HASHKEY |
Response | Description |
---|---|
401 | INVALID_MERCHANT_ID |
402 | INVALID_PRODUCT |
403 | INVALID_AMOUNT |
405 | INVALID_CURRENCY |
406 | INVALID_HASHCODE |
407 | INVALID_MERCHANT_FOR_INTEGRATION |
408 | INVALID_TRANSACTION_ID |
821 | QUERY_SERVICE_INVALID_MERCHANT_ID |
822 | QUERY_SERVICE_INVALID_TRANSACTION_ID |
823 | QUERY_SERVICE_INVALID_HASHKEY |
921 | CANCEL_SERVICE_INVALID_MERCHANT_ID |
922 | CANCEL_SERVICE_INVALID_TRANSACTION_ID |
923 | CANCEL_SERVICE_INVALID_CANCEL_REASON |
924 | CANCEL_SERVICE_INVALID_HASHKEY |
Response | Description |
---|---|
440 | DUPLICATE_TRANSACTION_ID |
441 | INVALID_CUSTOMER |
442 | INSUFFICIENT_BALANCE |
443 | SUBRESELLER_REACHED_LIMIT |
101 | INVALID_HANDSHAKE_RESPONSE |
103 | UNSUPPORTED_UNCODING |
104 | INVALID_HANDSHAKE_URL |
105 | INVALID_HANDSHAKE_CONNECTION_PROBLEM |
106 | UNKOWN_HANDSHAKE_RESPONSE_ERROR |
108 | MERCHANT_INTEGRATION_SUSPENDED |
201 | INVALID_REQUEST_VALUE |
202 | TRANSACTION_NOT_COMPLETED |
205 | SERVICE_DISABLED |
206 | LOCATION_CHANGED |
209 | IP_BLACK_LISTED |
210 | IP_CHANGED |
900 | CANCEL_SERVICE_TRANSACTION_CANCELED_SUCCESSFULLY |
925 | CANCEL_SERVICE_TRANSACTION_ALREADY_CANCELED |
926 | CANCEL_SERVICE_MERCHANT_CANNOT_CANCEL |
927 | CANCEL_SERVICE_TRANSACTION_EXCEED_TIME_LIMIT |
928 | CANCEL_SERVICE_TRANSACTION_EXCEED_VALUE_LIMIT |
500 | INTERNAL_SERVER_ERROR |