Introduction

Fatora gateway provides robust features for processing online payments, it processes payments securely and conveniently in real time.

  • Easy integration.
  • A flexibly adaptable solution for meeting your needs.
  • High level of data transfer security.

Start With Fatora Gateway

If you are new to Fatora gateway, you have to subscribe at the beginning.
To subscribe, you have to send the following information to Maktapp support.

  • Commercial registration.
  • A scan copy of a personal identification.
  • Application name.
  • Application type (website or mobile application).
  • API key of your application in Firebase Cloud Messaging (in case mobile application), Fatora gateway will send push notifications after the end of processing payments.
  • URL of success and failure page of your application to redirect clients to these URL after the end of proccessing payments.

After subscription, Maktapp support will send you an APIKEY, which is called Merchant Token, and later you will use it in calling Fatora API.

Steps Of Payment

An online payment goes through the following steps:

1. Initialize payment:

  • a client clicks on a pay or subscribe button in the merchant application.
  • the merchant application sends a request to Fatora gateway to get the URL of checkout page.
  • the merchant application redirects the client to this URL.

2. Process payment:

  • the client enters his card data and clicks pay button in checkout page.
  • Fatora gateway processes the payment and redirects the client to success page of the merchant application or the failure page according to payment status (SUCCESS or FAILURE).

3. Verify request source:

  • the merchant application receives a request to success or failure page.
  • the merchant application should verify source of request (from Fatora gateway or from hacker) by sending request to Fatora gateway to check payment status.

    enter image description here

Tokenization

Fatora gateway support tokenization to save your clients from having to re-enter card details in checkout page in each time they pay from your application. This will improve clients' user experience when making payments through your application.

Examples:

Autosave payment

When a client makes his first purchase in your application, after processing payment and in SUCCESS case Fatora gateway will send token (which is Card Token) to your application, your application should save it.

Therefore, when the client returns to your application to make another purchase, your application should send this token to Fatora gateway to use it in deducting amount directly from the client account without redirecting him to the checkout page.

Recurring payment or subscription

When a client subscribes in a service in your application, after processing subscription and in SUCCESS case, Fatora gateway will send token to your application.

Therefore, in each time a payment is due, your application will send this token to Fatora gateway to use it in deducting amount from the client account automatically.

Payment

Onetime Payment

<? php
init();
function init()
{
 $url = 'https://maktapp.credit/v3/AddTransaction';
 $data = array(
 'token'           => "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
 'FcmToken'        => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
 'currencyCode'    => "XXX", 
 'orderId'         => "XXXXXXX",
 'amount'          =>  XXXX, 
 'customerEmail'   => "XXXX",
 'customerName'    => "XXXX",
 'customerPhone'   => "XXXX",
 'customerCountry' => "XXXX",
 'lang'            => "XX",
 'note'            => "XXXXX"
);

 $response = curl_post( $url , $data );
 $data_json_decode = json_decode($response);
 $result = $data_json_decode->{'result'};

 return  $result;
}

function curl_post($url, array $post = NULL, array $options = array())
{ 
 $defaults = array(
 CURLOPT_POST           => 1,
 CURLOPT_HEADER         => 0,
 CURLOPT_URL            => $url,
 CURLOPT_FRESH_CONNECT  => 1,
 CURLOPT_RETURNTRANSFER => 1,
 CURLOPT_FORBID_REUSE   => 1,
 CURLOPT_TIMEOUT        => 500,
 CURLOPT_POSTFIELDS     => http_build_query($post)
 );
 $ch = curl_init();
 curl_setopt_array($ch, ($options + $defaults));
 if( ! $result = curl_exec($ch))
 {
 trigger_error(curl_error($ch));
 }
 curl_close($ch);
 return $result;
}
?>
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | 
                                       SecurityProtocolType.Tls   | SecurityProtocolType.Ssl3;
string apiUrl = "https://maktapp.credit/v3/AddTransaction ";
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
System.Collections.Specialized.NameValueCollection postData = new System.Collections.Specialized.NameValueCollection();
 {
    {"token", "E4B73FEE-F492-4607-A38D-852B0EBC91C9"}, 
    {"FcmToken", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"},
    {"currencyCode", "XXX"},
    {"orderId", "XXXXXXX"}, 
    {"amount", XXX},
    {"customerEmail", "XXXX"},   
    {"customerName",  "XXXX"},
    {"customerPhone", "XXXX"},
    {"customerCountry", "XXXX"},  
    {"lang", "XX"}, 
    {"note", "testpayment"}
 };
var res       = wc.UploadValues(apiUrl, postData);
string resStr = Encoding.UTF8.GetString(res);
}
<form>
<input type="button" id="SubmitPay" name="SubmitPay" value="submit" onclick="return pay();" />
</form>
<script>
function pay() {    
var dataToPost = {
"token": "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"FcmToken ":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"currencyCode": "XXX",
"orderId": "XXXXXXX",
"amount": XXXX,      
"customerEmail": "XXXX",
"customerName":"XXXX",
"customerPhone":"XXXX",
"customerCountry": "XXXX",
"lang": "XX",
"note": ""                
  };

    $.ajax({            
    url: 'https://maktapp.credit/v3/AddTransaction',
    data: dataToPost,
    type: "POST",
    dataType: "json",
    success: function (res) {                
             window.location.href = res.result;                                
        },
    error: function (result) {               
            alert("error: " + result);
        }
    });        
}
</script>

#POST curl https://maktapp.credit/v3/AddTransaction 
-H "Content-Type: application/json" 
-d ' {
"token":"E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"FcmToken":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"currencyCode":"XXX", 
"orderId":"XXXXXXX", 
"amount":XXXX,
"customerEmail":"XXXX",
"customerName":"XXXX",
"customerPhone":"XXXX",
"customerCountry":"XXX",
"lang":"XX", 
"note":"XXXX" 
}'

The above request will returns JSON structured if all parameters are valid like this:

{ 
    "result": "https://maktapp.credit/pay/MCPaymentPage?paymentID=XXXXXXXXXX" 
}

The above request will returns JSON structured if one parameter is null or not valid like this:

{ 
    "result": x 
} [-1, -2, -3, -6, -8, -10, -20, -21 ] 


This API allows the merchant application to initialize a onetime payment and get the URL of checkout page.

HTTP Request

POST https://maktapp.credit/v3/AddTransaction

Request Parameters

Parameter Restriction Description
token Required String value.
Merchant token.
FcmToken Optional String value.
Mobile FCM Token.
currencyCode Optional String value.
currency code of your country as an ISO 4217 alpha code.
The default code is QAR.
If you want to support more than one currency, contact with Maktapp support.
orderId Required String value.
A unique identifier for each payment in your application.
amount Required Decimal value.
Payment amount that will be deducted from the client account.
customerEmail Required String value, it should have valid email address format.
Client email address.
customerName Optional String value.
Client Name.
customerPhone Optional String value.
Client phone, including country code.
customerCountry Optional String value.
Client country.
lang Optional String value, it should have one of these value{"en","ar"}.
Language of checkout page.
Default value is "en".
note Optional String value.
Notes about the payment.

If all the required parameters are valid, Fatora gateway will return URL of checkout page in a JSON format, like following:

Response JSON

{ "result": "https://maktapp.credit/pay/MCPaymentPage?paymentID=XXXXXXXXXX" }

If the value of one parameter are not valid, Fatora gateway will return a response in JSON format containing error code, like following:

Response JSON

{ "result": x } [-1, -2, -3, -6, -8, -10, -20, -21 ]

After getting the URL of checkout page, the merchant application should redirect his client to this URL, when the client enters his card data in checkout page and clicks on pay button, Fatora gateway will process the payment and redirects the client to success or failure page of the merchant application.

In success case, Fatora gateway will redirect client to merchant SUCCESS page, and will request the merchant success page with the following parameters:

Redirect to success page

Merchant_SUCCESS_URL?transId=XXX&orderId=XXX&mode=XXX

In failure case, Fatora gateway will redirect client to merchant failure page, and will request merchant failure page with the following parameters:

Redirect to failure page

Merchant_FAILURE_URL?transId=XXX&orderId=XXX&Failerdescription=XXX

Request Parameters

Parameter Description
transId Transaction id of payment created by bank.
orderId OrderId of payment(sent by your application at requesting Initialize Payment API).
mode It has one of the following values {"test", "live"} according to merchant mode.
Failerdescription It describes why the payment is failed.

Recurring Payment

<? php
init();
function init()
{
 $url = 'https://maktapp.credit/v3/AddTransaction';
 $data = array(
 'token'           => "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
 'FcmToken'        => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
 'currencyCode'    => "XXX", 
 'orderId'         => "XXXXXXX",
 'amount'          =>  XXXX, 
 'customerEmail'   => "XXXX",
 'customerName'    => "XXXX",
 'customerPhone'   => "XXXX",
 'customerCountry' => "XXXX",
 'lang'            => "XX",
 'isRecurring'     => true, 
 'note'            => "XXXXX"
);

 $response = curl_post( $url , $data );
 $data_json_decode = json_decode($response);
 $result = $data_json_decode->{'result'};

 return  $result;
}

function curl_post($url, array $post = NULL, array $options = array())
{ 
 $defaults = array(
 CURLOPT_POST           => 1,
 CURLOPT_HEADER         => 0,
 CURLOPT_URL            => $url,
 CURLOPT_FRESH_CONNECT  => 1,
 CURLOPT_RETURNTRANSFER => 1,
 CURLOPT_FORBID_REUSE   => 1,
 CURLOPT_TIMEOUT        => 500,
 CURLOPT_POSTFIELDS     => http_build_query($post)
 );
 $ch = curl_init();
 curl_setopt_array($ch, ($options + $defaults));
 if( ! $result = curl_exec($ch))
 {
 trigger_error(curl_error($ch));
 }
 curl_close($ch);
 return $result;
}
?>
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | 
                                       SecurityProtocolType.Tls   | SecurityProtocolType.Ssl3;
string apiUrl = "https://maktapp.credit/v3/AddTransaction ";
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
System.Collections.Specialized.NameValueCollection postData = new System.Collections.Specialized.NameValueCollection();
 {
    {"token", "E4B73FEE-F492-4607-A38D-852B0EBC91C9"}, 
    {"FcmToken", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"},
    {"currencyCode", "XXX"},
    {"orderId", "XXXXXXX"}, 
    {"amount", XXX},
    {"customerEmail", "XXXX"},   
    {"customerName",  "XXXX"},
    {"customerPhone", "XXXX"},
    {"customerCountry", "XXXX"},  
    {"lang", "XX"},
    {"isRecurring", true},  
    {"note", "testpayment"}
 };
var res = wc.UploadValues(apiUrl, postData);
string resStr = Encoding.UTF8.GetString(res);
}
<form>
<input type="button" id="SubmitPay" name="SubmitPay" value="submit" onclick="return pay();" />
</form>
<script>
function pay() {    
var dataToPost = {
"token": "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"FcmToken ":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"currencyCode": "XXX",
"orderId": "XXXXXXX",
"amount": XXXX,      
"customerEmail": "XXXX",
"customerName":"XXXX",
"customerPhone":"XXXX",
"customerCountry": "XXXX",
"lang": "XX",
"isRecurring":true, 
"note": ""                      
  }; 

    $.ajax({            
    url: 'https://maktapp.credit/v3/AddTransaction',
    data: dataToPost,
    type: "POST",
    dataType: "json",
    success: function (res) {                
             window.location.href = res.result;                                
        },
    error: function (result) {               
            alert("error: " + result);
        }
    });        
}
</script>

#POST curl https://maktapp.credit/v3/AddTransaction 
-H "Content-Type: application/json" 
-d ' {
"token":"E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"FcmToken":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"currencyCode":"XXX", 
"orderId":"XXXXXXX", 
"amount":XXXX,
"customerEmail":"XXXX",
"customerName":"XXXX",
"customerPhone":"XXXX",
"customerCountry":"XXX",
"lang":"XX",
"isRecurring":true, 
"note":"XXXX" 
}' 

The above request will returns JSON structured if all parameters are valid:

{ 
    "result": "https://maktapp.credit/pay/MCPaymentPage?paymentID=XXXXXXXXXX" 
}

The above request will returns JSON structured if one parameter is null or not valid:

{ 
    "result": x
}  [-1, -2, -3, -6, -8, -10, -20, -21 ]

This API allows the merchant application to initialize a recurring payment and get the URL of checkout page.

HTTP Request

POST https://maktapp.credit/v3/AddTransaction

Request Parameters

Parameter Restriction Description
token Required String value.
Merchant token.
FcmToken Optional String value.
Mobile FCM Token.
currencyCode Optional String value.
currency code of your country as an ISO 4217 alpha code.
The default code is QAR.
If you want to support more thant one currency, contact with Maktapp support.
orderId Required String value.
A unique identifier for each payment in your application.
amount Required Decimal value.
Payment amount that will be deducted from the client's account.
customerEmail Required String value, it should have valid email address format.
Clients email address.
isRecurring Optional Boolean value.
To indicate the payment is recurring or not.
customerName Optional String value.
Clients Name.
customerPhone Optional String value.
Clients phone, including country code.
customerCountry Optional String value.
Clients country.
lang Optional String value, it should have one of these value{"en","ar"}.
Language of checkout page..
Default value is "en".
note Optional String value.
Notes about the payment.

If all the required parameter are valid, Fatora gateway will return URL of checkout page in a JSON format, like following:

Response JSON

{ "result": "https://maktapp.credit/pay/MCPaymentPage?paymentID=XXXXXXXXXX" }

If the value of one parameter are not valid, Fatora gateway will return a response in JSON format containing error code, like following:

Response JSON

{ "result": x } [-1, -2, -3, -6, -8, -10, -20, -21 ]

After getting URL of checkout page, the merchant application should redirect the client to this page, when the client enters his card data in checkout page and clicks on pay button, Fatora gateway will process payment and redirects the client to success or failure page in the merchant application.

In success case, Fatora gateway will redirect client to merchant SUCCESS page, and will request the merchant success page with the following parameters

Redirect to success page

Merchat_SUCCESS_URL?orderId=XXX&transId=XXX&token=XXX&mode=XXX

In failure case, Fatora gateway will redirect client to merchant failure page, and will request the merchant failure page with the following parameters:

Redirect to failure page

Merchat_FAILURE_URL?orderId=XXX&transId=XXX&token=XXX&mode=XXX&Failerdescription=XXX

Request Parameters

Parameter Description
transId Transaction id of payment created by bank.
orderId OrderId of payment(sent by your application at requesting initialize Payment API).
mode It has one of the following values {"test", "live"} according to merchant's mode.
cardToken Unique identifier extracted from card detail, you will use it to get a new payment from client automatically when the next payments is due.
Failerdescription It describes why the payment is failed.

Autosave Payment

<? php
init();
function init()
{
 $url = 'https://maktapp.credit/v3/AddTransaction';
 $data = array(
 'token'           => "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
 'FcmToken'        => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
 'currencyCode'    => "XXX", 
 'orderId'         => "XXXXXXX",
 'amount'          =>  XXXX, 
 'customerEmail'   => "XXXX",
 'customerName'    => "XXXX",
 'customerPhone'   => "XXXX",
 'customerCountry' => "XXXX",
 'lang'            => "XX",
 'isRecurring'     => false,
 'autoSave'        => "yes",  
 'note'            => "XXXXX"
 );

 $response = curl_post( $url , $data );
 $data_json_decode = json_decode($response);
 $result = $data_json_decode->{'result'};

 return  $result;
}

function curl_post($url, array $post = NULL, array $options = array())
{ 
 $defaults = array(
 CURLOPT_POST           => 1,
 CURLOPT_HEADER         => 0,
 CURLOPT_URL            => $url,
 CURLOPT_FRESH_CONNECT  => 1,
 CURLOPT_RETURNTRANSFER => 1,
 CURLOPT_FORBID_REUSE   => 1,
 CURLOPT_TIMEOUT        => 500,
 CURLOPT_POSTFIELDS     => http_build_query($post)
 );
 $ch = curl_init();
 curl_setopt_array($ch, ($options + $defaults));
 if( ! $result = curl_exec($ch))
 {
 trigger_error(curl_error($ch));
 }
 curl_close($ch);
 return $result;
}
?>
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | 
                                       SecurityProtocolType.Tls   | SecurityProtocolType.Ssl3;
string apiUrl = "https://maktapp.credit/v3/AddTransaction ";
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
System.Collections.Specialized.NameValueCollection postData = new System.Collections.Specialized.NameValueCollection();
 {
    {"token", "E4B73FEE-F492-4607-A38D-852B0EBC91C9"}, 
    {"FcmToken", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"},
    {"currencyCode", "XXX"},
    {"orderId", "XXXXXXX"}, 
    {"amount", XXX},
    {"customerEmail", "XXXX"},   
    {"customerName",  "XXXX"},
    {"customerPhone", "XXXX"},
    {"customerCountry", "XXXX"},  
    {"lang", "XX"},
    {"isRecurring" false},
    {"autoSave" ,"yes"},
    {"note", "XXXX"}
 };
var res = wc.UploadValues(apiUrl, postData);
string resStr = Encoding.UTF8.GetString(res);
}
<form>
<input type="button" id="SubmitPay" name="SubmitPay" value="submit" onclick="return pay();" />
</form>
<script>
function pay() {    
var dataToPost = {
"token": "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"FcmToken ":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"currencyCode": "XXX",
"orderId": "XXXXXXX",
"amount": XXXX,      
"customerEmail": "XXXX",
"customerName":"XXXX",
"customerPhone":"XXXX",
"customerCountry": "XXXX",
"lang": "XX",
"isRecurring":false, 
"autoSave":"yes",  
"note": ""                      
  };  

    $.ajax({            
    url: 'https://maktapp.credit/v3/AddTransaction',
    data: dataToPost,
    type: "POST",
    dataType: "json",
    success: function (res) {                
             window.location.href = res.result;                                
        },
    error: function (result) {               
            alert("error: " + result);
        }
    });        
}
</script>

#POST curl https://maktapp.credit/v3/AddTransaction 
-H "Content-Type: application/json" 
-d ' {
"token":"E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"FcmToken":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"currencyCode":"XXX", 
"orderId":"XXXXXXX", 
"amount":XXXX,
"customerEmail":"XXXX",
"customerName":"XXXX",
"customerPhone":"XXXX",
"customerCountry":"XXX",
"lang":"XX",
"isRecurring": false,  
"autoSave": "yes",  
"note": "XXXX" 
}' 

The above request will returns JSON structured if all parameters are valid:

{ 
    "result": "https://maktapp.credit/pay/MCPaymentPage?paymentID=XXXXXXXXXX" 
}

The above request will returns JSON structured if one parameter is null or not valid:

{ 
    "result": x 
} [-1, -2, -3, -6, -8, -10, -20, -21 ] 

This API allows the merchant application to initialize an autosave payment and get the URL of checkout page.

HTTP Request

POST https://maktapp.credit/v3/AddTransaction

Request Parameters

Parameter Restriction Description
token Required String value.
Merchant token.
FcmToken Optional String value.
Mobile FCM Token.
currencyCode Optional String value.
currency code of your country as an ISO 4217 alpha code.
The default code is QAR.
If you want to support more than one currency, contact with Maktapp support.
orderId Required String value.
A unique identifier for each payment in your application.
amount Required Decimal value.
Payment amount that will be deducted from the client account.
customerEmail Required String value, it should have valid email address format.
Client email address.
autosave Optional String value, should have one of the following values {"no", "yes"}.
To indicate if it is auto save payment or not.
customerName Optional String value.
Client Name.
customerPhone Optional String value.
Client phone, including country code.
customerCountry Optional String value.
Client country.
lang Optional String value, it should have one of these value{"en","ar"}.
Language of checkout page..
Default value is "en".
note Optional String value.
Notes about the payment.

If all the required parameter are valid, Fatora gateway will return URL of checkout page in a JSON format, like following:

Response JSON

{ "result": "https://maktapp.credit/pay/MCPaymentPage?paymentID=XXXXXXXXXX" }

If the values of one parameter are not valid, Fatora gateway will return a response in JSON format containing error code, like following:

Response JSON

{ "result": x } [-1, -2, -3, -6, -8, -10, -20, -21 ]

After getting URL of checkout page, the merchant application redirects the client to this page, when the client enters his card data in checkout page and clicks on pay button, Fatora API will proccess payment and redirects the client to success or failure page.

In success case, Fatora gateway will redirect client to merchant SUCCESS page, and will request the merchant success page with the following parameters:

Redirect to success page

Merchat_SUCCESS_URL?orderId=XXX&transId=XXX&token=XXX&mode=XXX

In failure case, Fatora gateway will redirect client to merchant failure page, and will call merchant failure page with the following parameters:

Redirect to failure page

Merchat_FAILURE_URL?orderId=XXX&transId=XXX&token=XXX&mode=XXX&Failerdescription=XXX

Request Parameters

Parameter Description
transId Transaction id of payment created by bank.
orderId OrderId of payment(sent by your application at requesting Initialize API).
mode It has one of the following values {"test", "live"} according to merchant mode.
cardToken Unique identifier extracted from card detail, you will use it to deduct amount from client directly when he makes another purchase in your application without redirecting him to checkout page.
Failedescription It describes why the payment is failed.

Get Card Token

<? php
init();
function init()
{
 $url = 'https://maktapp.credit/v3/AddTransaction';
 $data = array(
 'token'           => "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
 'FcmToken'        => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
 'currencyCode'    => "XXX", 
 'orderId'         => "XXXXXXX",
 'amount'          =>  XXXX, 
 'customerEmail'   => "XXXX",
 'customerName'    => "XXXX",
 'customerPhone'   => "XXXX",
 'customerCountry' => "XXXX",
 'lang'            => "XX",
 'isRecurring'     => true, 
 'isVoid'          => true,  
 'note'            => "XXXXX"
 );

 $response = curl_post( $url , $data );
 $data_json_decode = json_decode($response);
 $result = $data_json_decode->{'result'};

 return  $result;
}

function curl_post($url, array $post = NULL, array $options = array())
{ 
 $defaults = array(
 CURLOPT_POST           => 1,
 CURLOPT_HEADER         => 0,
 CURLOPT_URL            => $url,
 CURLOPT_FRESH_CONNECT  => 1,
 CURLOPT_RETURNTRANSFER => 1,
 CURLOPT_FORBID_REUSE   => 1,
 CURLOPT_TIMEOUT        => 500,
 CURLOPT_POSTFIELDS     => http_build_query($post)
 );
 $ch = curl_init();
 curl_setopt_array($ch, ($options + $defaults));
 if( ! $result = curl_exec($ch))
 {
 trigger_error(curl_error($ch));
 }
 curl_close($ch);
 return $result;
}
?>
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | 
                                       SecurityProtocolType.Tls | SecurityProtocolType.Ssl3;
string apiUrl = "https://maktapp.credit/v3/AddTransaction ";
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
System.Collections.Specialized.NameValueCollection postData = new System.Collections.Specialized.NameValueCollection();
 {
    {"token", "E4B73FEE-F492-4607-A38D-852B0EBC91C9"}, 
    {"FcmToken", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"},
    {"currencyCode", "XXX"},
    {"orderId", "XXXXXXX"}, 
    {"amount", XXX},
    {"customerEmail", "XXXX"},   
    {"customerName", "XXXX"},
    {"customerPhone", "XXXX"},
    {"customerCountry", "XXXX"},  
    {"lang", "XX"},
    {"isRecurring" true},
    {"isVoid" ,true},
    {"note", "testpayment"}
 };
var res = wc.UploadValues(apiUrl, postData);
string resStr = Encoding.UTF8.GetString(res);
}
<form>
<input type="button" id="SubmitPay" name="SubmitPay" value="submit" onclick="return pay();" />
</form>
<script>
function pay() {    
var dataToPost = {
"token": "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"FcmToken ":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"currencyCode": "XXX",
"orderId": "XXXXXXX",
"amount": XXXX,      
"customerEmail": XXXX,
"customerName":"XXXX",
"customerPhone":"XXXX",
"customerCountry": "XXXX",
"lang": "XX",
"isRecurring":true, 
"isVoid":true, 
"note": ""                     
  };  

    $.ajax({            
    url: 'https://maktapp.credit/v3/AddTransaction',
    data: dataToPost,
    type: "POST",
    dataType: "json",
    success: function (res) {                
             window.location.href = res.result;                                
        },
    error: function (result) {               
            alert("error: " + result);
        }
    });        
}
</script>
#POST curl https://maktapp.credit/v3/AddTransaction 
-H "Content-Type: application/json" 
-d ' {
"token":"E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"FcmToken":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"currencyCode":"XXX", 
"orderId":"XXXXXXX", 
"amount":XXXX,
"customerEmail":"XXXX",
"customerName":"XXXX",
"customerPhone":"XXXX",
"customerCountry":"XXX",
"lang":"XX",
"isRecurring":true, 
"isVoid":true,  
"note":"XXXX"
}'

The above request will returns JSON structured if all parameters are valid:


{ 
    "result": "https://maktapp.credit/pay/MCPaymentPage?paymentID=XXXXXXXXXX" 
}

The above request will returns JSON structured if one parameter is null or not valid:

{ 
    "result": x 
}  [-1, -2, -3, -6, -8, -10, -20, -21 ]

This API allows the merchant application to do the following:

  • Initialize a payment.
  • Mark this payment as "isvoided at request", so later when Fatora finishs processing payment and the payment successes, Fatora gateway will automatically try to void the payment (return money back to client).
  • Get the URL of checkout page.

HTTP Request

POST https://maktapp.credit/v3/AddTransaction

Request Parameters

Parameter Restriction Description
token Required String value.
Merchant token.
FcmToken Optional String value.
Mobile FCM Token.
currencyCode Optional String value.
currency code of your country as an ISO 4217 alpha code. The default code is QAR.
If you want to support more than one currency, contact with Maktapp support.
orderId Required String value.
A unique identifier for each payment in your application.
amount Required Decimal value.
Payment amount that will be deducted from the client account.
customerEmail Required String value, it should have valid email address format.
Client email address.
isRecurring Optional Boolean value.
To indicate the payment is recurring or not.
autosave Optional String value, should have one of the following values {"no","yes"}.
To indicate if it is auto save payment or not.
isVoid Optional Boolean value.
when this paramter has "true" value, Fatora gatway will try to return deducted amount to client account automatically after successful payment and get card token for the client card. It is used with isrecurring =true or autosave=yes.
customerName Optional String value.
Client Name.
customerPhone Optional String value.
Client phone, including country code.
customerCountry Optional String value.
Client country.
lang Optional String value, it should have one of these value{"en","ar"}.
Language of checkout page..
Default value is "en".
note Optional String value.
Notes about the payment.

If all the required parameter are valid, Fatora gateway will return URL of checkout page in a JSON format, like following:

Response JSON

{ "result": "https://maktapp.credit/pay/MCPaymentPage?paymentID=XXXXXXXXXX" }

If the values of one parameter are not valid, Fatora gateway will return a response in JSON format containing error code, like following:

Response JSON

{ "result": x } [-1, -2, -3, -6, -8, -10, -20, -21 ]

After processing payment and in "SUCCESS" case, if FATORA gateway succeeded in voiding payment, FATORA gateway will redirect client to merchant success page, and will request merchant success page with the following parameters:

Redirect to success page

Merchat_SUCCESS_URL?transid=XXXX&orderId=XXXX&mode=XXXX&refunded=yes&RTransactionID=XXXX&token=XXXX

If FATORA gateway failed in voiding payment, FATORA gateway will redirect client to merchant success page, and will request Merchant Success page with the following parameters:

Redirect to success page

Merchant_Success_URL?transid=XXXX&orderId=XXXX&mode=XXXX&refunded=no&RefundDescription=XXXX&token=XXXX

In failure case, Fatora gateway will redirect client to merchant failure page, and will call merchant failure page with the following parameters:

Redirect to failure page

Merchat_FAILURE_URL?orderId=XXX&transId=XXX&token=XXX&mode=XXX&Failerdescription=XXX

Request Parameters

Parameter Description
transId Transaction id of payment created by bank.
orderId Ordered of payment(sent by your application at requesting Initialize API).
mode It has one of the following values {"test", "live"} according to merchant mode.
cardToken Unique identifier extracted from card detail, you will use it to get deduct amount from client directly when he makes another purchase in your application without redirecting him to checkout page.
refunded Has one of the following values {"yes"
RTransactionID Transaction id of refund process in bank.
RefundDescription It describes why the refund request sent by Fatora gateway is failed.
Failerdescription It describes why the payment is failed.

Check Payment Status

<? php
init();
function init()
{
 $url = 'https://maktapp.credit/v3/CheckStatus';
 $data = array(
 'token'           => 'E4B73FEE-F492-4607-A38D-852B0EBC91C9', 
 'orderId'         => 'XXXXXXX' 
);

 $response = curl_post( $url , $data );
 $data_json_decode = json_decode($response);
 $result = $data_json_decode->{'result'};

 return  $result;
}

function curl_post($url, array $post = NULL, array $options = array())
{ 
 $defaults = array(
 CURLOPT_POST           => 1,
 CURLOPT_HEADER         => 0,
 CURLOPT_URL            => $url,
 CURLOPT_FRESH_CONNECT  => 1,
 CURLOPT_RETURNTRANSFER => 1,
 CURLOPT_FORBID_REUSE   => 1,
 CURLOPT_TIMEOUT        => 500,
 CURLOPT_POSTFIELDS     => http_build_query($post)
 );
 $ch = curl_init();
 curl_setopt_array($ch, ($options + $defaults));
 if( ! $result = curl_exec($ch))
 {
 trigger_error(curl_error($ch));
 }
 curl_close($ch);
 return $result;
}
?>
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | 
                                       SecurityProtocolType.Tls | SecurityProtocolType.Ssl3;
string apiUrl = "https://maktapp.credit/v3/CheckStatus";
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
System.Collections.Specialized.NameValueCollection postData =new System.Collections.Specialized.NameValueCollection();
 {
    {"token","E4B73FEE-F492-4607-A38D-852B0EBC91C9"},        
    {"orderId","XXXXXXX"}
 };
var res       = wc.UploadValues(apiUrl, postData);
string resStr = Encoding.UTF8.GetString(res);

ValidateResponse result= Newtonsoft.Json.JsonConvert.DeserializeObject<ValidateResponse>(resStr);
public class ValidateResponse
{
    publicint result { set; get; }
    public PaymentDetails payment { set; get; }
}
public class PaymentDetails
{
public string  transactionID { set; get; }
public string  customerName { set; get; }
public string  customerPhone{set;get;}
public decimal PaymentAmount { set; get; }
public string  CurrencyCode { set; get; }
public string  CustomerEmail { set; get; }
public string  PaymentDate { set; get; }
public string  Paymentstate { set; get; }
public string  Mode { set; get; }
public string  auth { set; get; }
public decimal ExchangeRate { set; get; }
public decimal PaidAmount { set; get; }
public string  token{set;get;}public decimal description {set;get;}
public bool    refundState{set;get;}
public string  refundstatus{set;get;}        public stringrefundDescription{set;get;}
public string  refundTransactionId{set;get;}
}


#POST curl https://maktapp.credit/v3/CheckStatus 
-H "Content-Type: application/json"
-d ' { 
"token":"E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"orderId":"XXXXXXX"
}'

The above request will returns JSON structured if Fatora gateway find the payment:

{ 
    "result": 1,
    "payment":
    {
        "transactionID": "XXXXXXX",
        "amount": XXXX,
        "currencyCode":  "XXX",
        "customerEmail": "XXXX",
        "customerPhone": "XXXX",
        "customerName":  "XXXX",
        "paymentDate":   "XXXX",
        "paymentstate":  "XXXX" [SUCCESS, PENDING,FAILURE], 
        "auth" : "XXXX",
        "mode": "XXX" [Live, Test] ,
        "ExchangeRate":0,
        "token":null,
        "description":"Transation Successfull",
        "refundState":false,
        "refundstatus":null,
        "refundDescription":null,
        "refundTransactionId":null
    } 
}

Response if Fatora gatway dos not find the payment:

{ 
    "result": 0
}

Response in case one of the request parameters is null or not valid:

{ 
    "result": X
} [-1, -2, -3, -6, -8, -10, -20, -21 ]

This API allows merchant application to get payment details, like status [PENDING, SUCCESS, FAILURE], transactionid, amount, currency code, client detail and other details.
You can use this API in each time your success page is requested:

  • To ensure that Fatora gateway which issued that request.
  • To ignore all the requests after first request, Fatora may request success page page more than once.

HTTP Request

POST https://maktapp.credit/v3/CheckStatus

Request Parameters

Parameter Restriction Description
token Required Merchant token.
orderId Required OrderId of payment(sent by your application at requesting initialize Payment API).
transactionID Optional Transactionid of payment.

Collect Payment For Recurring

<? php
init();
function init()
{
 $url = 'https://maktapp.credit/v3/GetnewPayment';
 $data = array(
 'token'           => "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
 'cardToken'       => "XXXXXXX" 

);

 $response = curl_post( $url , $data );
 $data_json_decode = json_decode($response);
 $result = $data_json_decode->{'result'};

 return  $result;
}

function curl_post($url, array $post = NULL, array $options = array())
{ 
 $defaults = array(
 CURLOPT_POST           => 1,
 CURLOPT_HEADER         => 0,
 CURLOPT_URL            => $url,
 CURLOPT_FRESH_CONNECT  => 1,
 CURLOPT_RETURNTRANSFER => 1,
 CURLOPT_FORBID_REUSE   => 1,
 CURLOPT_TIMEOUT        => 500,
 CURLOPT_POSTFIELDS     => http_build_query($post)
 );
 $ch = curl_init();
 curl_setopt_array($ch, ($options + $defaults));
 if( ! $result = curl_exec($ch))
 {
 trigger_error(curl_error($ch));
 }
 curl_close($ch);
 return $result;
}
?>
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | 
                                       SecurityProtocolType.Tls   | SecurityProtocolType.Ssl3;
string apiUrl = "https://maktapp.credit/v3/GetnewPayment";
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
System.Collections.Specialized.NameValueCollection postData = new System.Collections.Specialized.NameValueCollection();
 {
    {"token", "E4B73FEE-F492-4607-A38D-852B0EBC91C9"},    
    {"cardToken","XXXXXXX"}

 };
var res       = wc.UploadValues(apiUrl, postData);
string resStr = Encoding.UTF8.GetString(res);
NewPaymentDetail result = Newtonsoft.Json.JsonConvert.DeserializeObject<NewPaymentDetail >(resStr);

public class NewPaymentDetail
{
    public int    result { set; get; }
    public string transactionID { set; get; }        
    public string Mode { set; get; }
    public string auth { set; get; }
    public string description{ set; get; }
}

#POST curl https://maktapp.credit/v3/GetnewPayment 
-H "Content-Type: application/json"
-d ' {
"token":"E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"cardToken":"XXXXXXX"

}'

The above request will returns JSON structured if fator gateway succeed in getting new payment:

{ 
    "result":1,
    "transactionId":"XXXXXXXXXX", 
    "authcode":"XXXXXXXXXX",
    "mode":"test" 
}

The above request will returns JSON structured if fator gateway failed in getting new payment:

{ 
    "result":0, 
    "transactionid":"XXXXXXXXXX",
    "description":"Failure description"
}

This API allows the merchant application to get a new payment from client using cardToken [for a recurring payment ] when the payment is due, directly without requesting checkout page.

HTTP Request

POST https://maktapp.credit/v3/GetnewPayment

Request Parameters

Parameter Restriction Description
token Required Merchant token.
cardToken Required Card token which Fatora gateway send to your application after successful recurring or autosave payment.

Collect Payment For Autosave

<? php
init();
function init()
{
 $url = 'https://maktapp.credit/v3/GetnewPayment';
 $data = array(
 'token'           => 'E4B73FEE-F492-4607-A38D-852B0EBC91C9',
 'cardToken'       => 'XXXXXXX', 
 'orderId'         => 'XXXXXXX', 
 'amount'          =>  XXXX 
);

 $response = curl_post( $url , $data );
 $data_json_decode = json_decode($response);
 $result = $data_json_decode->{'result'};

 return  $result;
}

function curl_post($url, array $post = NULL, array $options = array())
{ 
 $defaults = array(
 CURLOPT_POST           => 1,
 CURLOPT_HEADER         => 0,
 CURLOPT_URL            => $url,
 CURLOPT_FRESH_CONNECT  => 1,
 CURLOPT_RETURNTRANSFER => 1,
 CURLOPT_FORBID_REUSE   => 1,
 CURLOPT_TIMEOUT        => 500,
 CURLOPT_POSTFIELDS     => http_build_query($post)
 );
 $ch = curl_init();
 curl_setopt_array($ch, ($options + $defaults));
 if( ! $result = curl_exec($ch))
 {
 trigger_error(curl_error($ch));
 }
 curl_close($ch);
 return $result;
}
?>
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | 
                                       SecurityProtocolType.Tls   | SecurityProtocolType.Ssl3;
string apiUrl = "https://maktapp.credit/v3/GetnewPayment";
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
System.Collections.Specialized.NameValueCollection postData = new System.Collections.Specialized.NameValueCollection();
 {
    {"token", "E4B73FEE-F492-4607-A38D-852B0EBC91C9"},    
    {"cardToken","XXXXXXX"},
    {"orderId": "XXXXXXX"},
    {"amount", XXXX},      
 };
var res       = wc.UploadValues(apiUrl, postData);
string resStr = Encoding.UTF8.GetString(res);
NewPaymentDetail result = Newtonsoft.Json.JsonConvert.DeserializeObject<NewPaymentDetail >(resStr);

public class NewPaymentDetail
{
    public int    result { set; get; }
    public string transactionID { set; get; }        
    public string Mode { set; get; }
    public string auth { set; get; }
    public string description{ set; get; }
}
<form>
<input type="button" id="SubmitPay" name="SubmitPay" value="submit" onclick="return pay();" />
</form>
<script>
function pay() {    
    var dataToPost = {
    "token": "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
    "cardToken":"XXXXXXX",
    "orderId": "XXXXXXX"
    "amount": XXXX,
      };

    $.ajax({            
    url: 'https://maktapp.credit/v3/GetnewPayment',
    data: dataToPost,
    type: "POST",
    dataType: "json",
    success: function (res) {                
        window.location.href = res.result;                                
    },
    error: function (result) {               
        alert("error: " + result);
    }
    });        
}
</script>
#POST curl https://maktapp.credit/v3/GetnewPayment 
-H "Content-Type: application/json"
-d ' {
"token":"E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"cardToken":"XXXXXXX",
"orderId":"XXXXXXX",
"amount":XXXX   
}'

The above request will returns JSON structured if fator gateway succeed in getting new payment:


{ 
    "result":1,
    "transactionid":"XXXXXXXXXXXXXXXXXXX",
    "authcode":"XXXXXXXXXX",
    "mode":"test" 
}

The above request will returns JSON structured if fator gateway failed in getting new payment:

{ 
    "result":0, 
    "transactionid":"XXXXXXXXXXXXXXXXXXX",
    "description":"Failure description"
}

This API allows the merchant application get new payment from client using cardToken, which your application received after a successful autosave payment for the client.

HTTP Request

POST https://maktapp.credit/v3/GetnewPayment

Request Parameters

Parameter Restriction Description
token Required Merchant token.
cardToken Required Card token which Fatora gateway send to your application after successful recurring or autosave payment.
amount Required Amount to be deducted from client account.
orderId Required A unique identifier for each payment in your application.

Deactivate Card Token

<? php
init();
function init()
{
 $url = 'https://maktapp.credit/v3/StopRecurring';
 $data = array(
 'token'           => 'E4B73FEE-F492-4607-A38D-852B0EBC91C9',
 'cardToken'       => 'XXXXXXX' 
);

 $response = curl_post( $url , $data );
 $data_json_decode = json_decode($response);
 $result = $data_json_decode->{'result'};

 return  $result;
}

function curl_post($url, array $post = NULL, array $options = array())
{ 
 $defaults = array(
 CURLOPT_POST           => 1,
 CURLOPT_HEADER         => 0,
 CURLOPT_URL            => $url,
 CURLOPT_FRESH_CONNECT  => 1,
 CURLOPT_RETURNTRANSFER => 1,
 CURLOPT_FORBID_REUSE   => 1,
 CURLOPT_TIMEOUT        => 500,
 CURLOPT_POSTFIELDS     => http_build_query($post)
 );
 $ch = curl_init();
 curl_setopt_array($ch, ($options + $defaults));
 if( ! $result = curl_exec($ch))
 {
 trigger_error(curl_error($ch));
 }
 curl_close($ch);
 return $result;
}
?>
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | 
                                       SecurityProtocolType.Tls   | SecurityProtocolType.Ssl3;
string apiUrl = "https://maktapp.credit/v3/StopRecurring ";
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
System.Collections.Specialized.NameValueCollection postData = new System.Collections.Specialized.NameValueCollection();
 {
    {"token", "E4B73FEE-F492-4607-A38D-852B0EBC91C9"}, 
    {"cardToken", "XXXXXXX"}
 };
var res       = wc.UploadValues(apiUrl, postData);
string resStr = Encoding.UTF8.GetString(res);
}
#POST curl https://maktapp.credit/v3/StopRecurring 
-H "Content-Type: application/json" 
-d ' {
"token":"E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"cardToken":"XXXXXXX"
}'
<form>
<input type="button" id="SubmitPay" name="SubmitPay" value="submit" onclick="return pay();" />
</form>
<script>
function pay() {    
var dataToPost = {
"token": "E4B73FEE-F492-4607-A38D-852B0EBC91C9",
"cardToken ":"XXXXXXX"     
};  
    $.ajax({            
    url: 'https://maktapp.credit/v3/StopRecurring',
    data: dataToPost,
    type: "POST",
    dataType: "json",
    success: function (res) {                

      },
    error: function (result) {               
            alert("error: " + result);
     }
    });        
}
</script>

The above request will returns JSON structured if fator gateway succeed in deactivate card token :

{ 
    "result":1
}

The above request will returns JSON structured if fator gateway failed in deactivate card token :

{ 
  "result": "X" 
} [-1, -2, -3, -6, -8, -10, -20, -21 ] 

This API allows merchant application to disable card token, so merchant application couldn't able to deduct money from the client account using card token.

HTTP Request

POST https://maktapp.credit/v3/StopRecurring

Request Parameters

Parameter Type Required (Yes, No) Description
token String Yes It is the merchant's token.
cardToken String Yes must be Unique, created by bank for client`s card who set autosave payment type to yes.

Test

Now Fatora gateway doesn't support test card data, but you can test your application and see the steps of payment using TestMode for your merchant.
there is two mode for merchant application, Live mode and Test Mode.
to make you merchant in Test mode, contact Maktapp support.

when the merchant is in Test mode, all his payment are in test mode also, and you will not see these payments in your balance in your account in Fatora.

Step of Payment in Test Mode

  • a client clicks on a pay or subscribe button in the merchant application
    client clicks on a pay or subscribe button in merchant application

  • the merchant application sends a request to Fatora gateway to get URL of checkout page.

  • the merchant application redirects the client to this page.
    client clicks on a pay or subscribe button in merchant application

  • the client enters his card data, and clicks pay button in checkout page.

  • Fatora gateway processes payment and redirects client to success page of merchant application if your enter 123 in CVV field in checkout page. success payment process

or Fatora gateway redirects client to failure page with failure details if your enter any value other than 123 in CVV field in checkout page. error payment process

Errors

<? php
function CheckResponseStatus($result, $msg){

    switch ($result){        
        case -1:           
            $msg = "Unauthorized -- API key is invaild(not Valid GUID), or no merchant for this token";
            break;
        case -2:
            $msg = "Not Found -- The specified orderId could not be found.";
            break;
        case -3:
            $msg = "Not Support -- merchnat application doesn't support the sent currency code.";
            break;
        case -7:
            $msg = "Not Found -- there isn't any recurring or autosave payment in Fatora gateway for this merchant with the request parameter.";
            break;
        case -8:
            $msg = "Invalid -- Token is not valid guid.";
            break;
        case -10:
            $msg = "Bad Request -- required parameters requested aren't sent in request.";
            break;
        case -20:
            $msg = "Not Found -- There isn't application data for the merchant for the sent currency in payment gateway.";
            break;
        case -21:
            $msg = "Not Support -- payment gateway doesn't support void payment";
            break;
        default:
            $msg = "success";
            break;
    }
    echo $msg;
} 
?>
public string CheckResponseStatus(int result)
{
    string msg = "";
    switch (result)
    {
        case -1:
            msg = "Unauthorized -- API key is invaild(not Valid GUID), or no merchant for this token";
            break;
        case -2:
            msg = "Not Found -- The specified orderId could not be found.";
            break;
        case -3:
            msg = "Not Support -- merchnat application doesn't support the sent currency code.";
            break;
        case -7:
            msg = "Not Found -- there isn't any recurring or autosave payment in Fatora gateway for this merchant with the request parameter.";
            break;
        case -8:
            msg = "Invalid -- Token is not valid guid.";
            break;
        case -10:
            msg = "Bad Request -- required parameters requested aren't sent in request.";
            break;
        case -20:
            msg = "Not Found -- There isn't application data for the merchant for the sent currency in payment gateway.";
            break;
        case -21:
            msg = "Not Support -- payment gateway doesn't support void payment";
            break;
        default:
            msg = "success";
            break;
    }
    Console.WriteLine(msg);
}

<script>
function  CheckResponseStatus(result)
{
    var msg = "";
    switch (result)
    {   
        case -1:
            msg = "Unauthorized -- API key is invaild(not Valid GUID), or no merchant for this token";
            break;
        case -2:
            msg = "Not Found -- The specified orderId could not be found.";
            break;
        case -3:
            msg = "Not Support -- merchnat application doesn't support the sent currency code.";
            break;
        case -7:
            msg = "Not Found -- there isn't any recurring or autosave payment in Fatora gateway for this merchant with the request parameter.";
            break;
        case -8:
            msg = "Invalid -- Token is not valid guid.";
            break;
        case -10:
            msg = "Bad Request -- required parameters requested aren't sent in request.";
            break;
        case -20:
            msg = "Not Found -- There isn't application data for the merchant for the sent currency in payment gateway.";
            break;
        case -21:
            msg = "Not Support -- payment gateway doesn't support void payment";
            break;
        default:
            msg = "success";
            break;
        }
        alert(msg);
}
</script>

The Fator API uses the following error codes:

Error Code Meaning
-1 Unauthorized -- API key is invaild(not Valid GUID), or no merchant for this token
-2 Not Found -- The specified orderId could not be found.
-3 Not Support -- merchnat application doesn't support the sent currency code
-7 Not Found -- there isn't any recurring or autosave payment in Fatora gateway for this merchant with the request parameter.
-8 Invalid -- Token is not valid guid.
-10 Bad Request -- required parameters requested aren't sent in request.
-20 Not Found -- There isn't application data for the merchant for the sent currency in payment gateway.
-21 Not Support -- payment gateway doesn't support void payment

FAQs

Is card token expired?

  • Yes, it is expired automatically when the client card expired.
  • Yes, it is expired when you call "Deactivate Card Token" API.

Therefore, if you want to collect new payments from the same client, you have to get a new card token again.

What does happen if we generating more than card token?

  • All these card tokens ard valid, and you can use any one of them to collect payments from client.
  • All these card tokens are expired if the client card expired.
  • If you call "Deactivate Card Token" API for certian card token, it is only expired.

Does debit card support recurring payments? - No, debit cards issued in Qatar do not support recurring payments; so if a client try to pay a recurring payment using debit card the payment fails.

Does Fatora gateway validate if "OrderId" is unique at your application level when trying to get checkout page URL?

  • No, Fatora gateway validates if "OrderId" paramter has value or not.

Whats are the possible values that "OrderId" paramter could take?

  • It is string value, it may contains numbers, chars, comma, dash, etc; it contains any character.

What does the SUCCESS URL and FAILURE URL look like?

  • It looks like the following URL (without parameters):

  • https://www.example.com

  • http://www.example.com

  • http://blog.example.com

  • http://www.example.com/product

  • http://www.example.com#up

  • http://255.255.255.255

Does card token contain special characters?

  • Yes, it may contains special characters, so be careful in receiving and saving it in your application.

What does happen when a client try to open checkout page after paying?

  • If the payment succeeded, the client will be redirected to Fatora gateway success page for a few seconds and then will be redirected to your success page. success payment process

Plugin

SDK

SDK & API