# Introduction

Welcome to Casheer Pay. In this section, you'll find comprehensive guides and documentation to start working with Casheer Pay.

Casheer Pay helps you to quickly start accepting payments from your customers by integrating to your website and mobile app.

### Get Started

What do you need to get started with Casheer Pay? It's easy. Here's how.&#x20;

### 1. Sign up&#x20;

If you don’t have an account yet, this is the place to begin. Visit the [sign up page](https://kwpaysb.casheer.com/),  where you can register with just an email address and password. **We offer a free account for you to try our service in test mode.**

### 2. Prepare Your API Keys&#x20;

After sign in to the dashboard, get your API keys to authenticate your API request.

{% hint style="warning" %}
Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
{% endhint %}

### 3. Start Integration

Congratulations! you are ready to accept online payments directly and securely on your website and mobile app via different payment methods. (Or) You can explore the payment experience by integrating it with our test credentials.


# Integration Steps

It's simple 3 steps approach

### **Step 1:** Get Payment URL

You will be calling API  by posting the required parameters to get Payment URL for the transaction. This is the initial step of  integration which is to create orders in Casheer Pay platform.

### **Step 2:** Redirect to Payment URL

Once Payment URL generated with the above step,  redirect the customer to Payment URL and it may redirect to Actual Payment Gateway page or it may redirect to Casheer Single page which presents all the payment methods assigned to merchant. Here user /payer has to enter the Debit/Credit/Wallet details to get deducted the amount. Casheer Pay platform will get updated by  Payment  gateway provider.

### **Step 3:** Casheer Pay Redirect Back to Merchant

Soon after amount Captured/Not Captured status received from payment gateway provider, Casheer will redirect transaction  Result to Merchant Call Back URL which passed in the request mentioned in Step 1. Depends upon the Result, Merchant portal can decide the receipt for the customer.&#x20;


# Types of Integration

This section describes the how to integrate our payment gateway.

Casheer Pay platform offers a complete, easy-to-use guide to enable a seamless integration of our end-to-end payment gateway for Web and Mobile App. Through a unified API, you can enable and gain access to all platform features. Choose one of the options below to quickly get started.

We offer three types of integration in our pay flow.

1. Standard Pay&#x20;
2. eCommerce Plugins/Apps
3. Web & Mobile SDKs Integration

### **1. Standard Pay Method**

A standard Pay method is an out-of-the-box payment page where customers are redirected when they are ready to pay. The payment gateway securely receives the transaction data before it passes it to the acquirer. This method reduces the PCI burden for online merchants if you don’t collect and/or store the cardholder data on your server.

![](/files/-MSNkM79Sr06FXCIAX3w)

The following sections define the APIs and parameters that you will use to make requests to our gateway.

### **2.** eCommerce Plugins/Apps

We currently offer a variety of plugins that integrate Casheer Pay within leading eCommerce systems. You can use our below available plugins for a seamless integration that allows customers to pay on your website without writing the payments code yourself.

**Available Plugins/Apps**

1. WooCommerce
2. Magento 1 & 2
3. OpenCart
4. PrestaShop
5. Drupal Commerce&#x20;
6. Joomla (VirtueMart)
7. WHMCS

#### Coming Soon

1. Shopify
2. ECWID

### 3. Web & Mobile SDKs

Our Web & Mobile SDKs makes it easy for merchants to develop natively with secure payments capability

**Available Web/Mobile SDKs**

1. C#
2. VB.Net
3. Java
4. PHP
5. IOS
6. Android


# 1. Standard Pay

A standard pay method is an out-of-the-box payment page where customers are redirected when they are ready to pay. The payment gateway securely receives the transaction data before it passes it to the acquirer. This method reduces the PCI burden for online merchants if you don’t collect and/or store the cardholder data on your server.

![](/files/-MSNkM79Sr06FXCIAX3w)

####

1. [Get Payment URL](/sample-code/1.-gettrackid)
2. [Redirect to Payment URL](/sample-code/2.-redirect-to-og-pay)
3. [CallBack to Merchant](/sample-code/3.-callback-merchant-portal)&#x20;


# 2. Plugins

### eCommerce Plugins/Apps

We currently offer a variety of plugins that integrate Casheer Pay within leading eCommerce systems. You can use our below available plugins for a seamless integration that allows customers to pay on your website without writing the payments code yourself.

**Available Plugins/Apps**

1. WooCommerce
2. Drupal Commerce&#x20;
3. OpenCart
4. Magento 1 & 2
5. PrestaShop
6. Joomla (VirtueMart)
7. WHMCS&#x20;


# 3. SDK

### Web & Mobile SDKs

Our Web & Mobile SDKs makes it easy for merchants to develop natively with secure payments capability

**Available Web/Mobile SDKs**

1. C#
2. VB.Net
3. Java
4. PHP
5. IOS
6. Android


# Sample Code

In this section, you 'll find the list of attributes for creating the payment order & sample request & response code for integrity.

###

###


# 1. Get Payment URL

### Swagger Link

{% tabs %}
{% tab title="Production " %}

```shortcode
https://kwpayapi.casheer.com/V1/
```

{% endtab %}

{% tab title="Sandbox" %}

```
https://kwpayapisb.casheer.com/V1/
```

{% endtab %}
{% endtabs %}

### API Endpoints

{% tabs %}
{% tab title="Production Endpoint " %}

```
https://kwpayapisb.casheer.com/V1/api/GenToken/Validate
```

{% endtab %}

{% tab title="Sandbox Endpoint" %}

```
https://kwpayapisb.casheer.com/V1/api/GenToken/Validate
```

{% endtab %}
{% endtabs %}

#### **Sample Request & Response**

Use the below parameters and hashing function for order creation. The request should contain the following inputs to make sure inputs should be encrypted using our hashing function show in the following example to prevent exposure. For parameters description please refer [here](/parameters-and-description)

{% tabs %}
{% tab title="Sample Request" %}

```coffeescript
"ValidatePaymentRequest" : {
  "merchantCode": "xxxxx"    
  "authKey": "xxxxxxxxx",
  "currency": "KWD",   
  "pc": "KWKFHMPGSCCKWD",  
  "tunnel": "",    
  "amount": 1 ,   
  "doConvert": "N",
  "sourceCurrency":"conditional",
  "description": "optional",
  "referenceID": "(15 digit random number)",     
  "timeStamp": "yyyy/MM/dd HH:mm:ss tt",
  "language": "en",
  "callbackURL": "Your website URL",
  "hash": "ComputedHash",  
  "userReference": 0,   
  "billingDetails": 
  {
  "fName": "First Name",
  "lName": "last Name",
  "mobile": "mobile",
  "email": "email",
  "city": "city",
  "pincode": "pincode",
  "state": "state",
  "address1": "address1",
  "address2": "address2"
  }
}
```

{% endtab %}

{% tab title="Sample Response" %}

```
{
  "errorCode": 0,
  "errorMessgae": "string",
  "result": 
  {
    "redirectURL": "string",
    "tokenID": "string",    
    "orderAmount": 0,
    "paidAmount": 0,
    "serviceAmount": 0,
    "commissionAmount": 0,   
    "originalAmount": "string"
  }
}
```

{% endtab %}
{% endtabs %}

#### Multi Vendor Request  & Response

To create a **multivendor payment request**, you must include an additional parameter in the request body called **`SubVendors`**. This parameter is an array that contains objects representing each individual vendor involved in the transaction. Each object within the `SubVendors` array must include the following fields in request body:

{% tabs %}
{% tab title="Multivendor Sample Request" %}

```
"ValidatePaymentRequest" : {
  "merchantCode": "xxxxx"    
  "authKey": "xxxxxxxxx",
  "currency": "KWD",   
  "pc": "KWKFHMPGSCCKWD",  
  "tunnel": "",    
  "amount": 10 ,   
  "doConvert": "N",
  "sourceCurrency":"conditional",
  "description": "optional",
  "referenceID": "(15 digit random number)",     
  "timeStamp": "yyyy/MM/dd HH:mm:ss tt",
  "language": "en",
  "callbackURL": "Your website URL",
  "hash": "ComputedHash",  
  "userReference": 0,   
  "billingDetails": 
  {
  "fName": "First Name",
  "lName": "last Name",
  "mobile": "mobile",
  "email": "email",
  "city": "city",
  "pincode": "pincode",
  "state": "state",
  "address1": "address1",
  "address2": "address2"
  },
  "SubVendors": [
  {
    "id": "XXXXX", //the vendor’s merchantcode
    "description": "otional",
    "amount": 5, //the portion of the total payment allocated to this vendor
    "vendorReference": 183164329829353, //a unique transaction reference number
    "hash": "ComputedVendorHash" 
  },
  {
    "id": "XXXXXX",
    "description": "optional",
    "amount": 5,
    "vendorReference": 183164329829365,
    "hash": "ComputedVendorHash"
  }
]
}
```

{% endtab %}

{% tab title="Sample Response" %}
S
{% endtab %}
{% endtabs %}

### **Sample Code to post data**

{% tabs %}
{% tab title="C#" %}

```csharp
public async Task> ValidatePayment(ValidatePaymentRequest obj)
  {
  Output dto = new Output();
  var url = {Provided End Point};
  var client = new HttpClient();
  client.BaseAddress = new Uri(url);
  try
  {
  obj.hash = ComputeHash(obj);
  var resultser = JsonConvert.SerializeObject(obj);
  client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
  var response = client.PostAsJsonAsync(url, obj).Result;
  if (response.IsSuccessStatusCode)
  {
  var ss = response.Content.ReadAsStringAsync();
  var result = JsonConvert.DeserializeObject>(ss.Result);
  dto = result;
  }
  else
  {
  var ss = response.Content.ReadAsStringAsync();
  var resps = ss.Result.ToString();
  }
  }
  catch (HttpRequestException ex)
  {
  }
  return dto;
  }
```

{% endtab %}

{% tab title=" VB.Net" %}

```objectivec
  Class SurroundingClass
  Public Task As async
  
  Private Sub New(ByVal obj As ValidatePaymentRequest)
  Dim dto As Output = New Output()
  Dim url = {Provided End Point};
  Dim client = New HttpClient()
  client.BaseAddress = New Uri(url)
  
  Try
  obj.hash = ComputeHash(obj)
  Dim resultser = JsonConvert.SerializeObject(obj)
  client.DefaultRequestHeaders.Accept.Add(New System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"))
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8")
  Dim response = client.PostAsJsonAsync(url, obj).Result
  
  If response.IsSuccessStatusCode Then
  Dim ss = response.Content.ReadAsStringAsync()
  Dim result = JsonConvert.DeserializeObject > (ss.Result)
  dto = result
  Else
  Dim ss = response.Content.ReadAsStringAsync()
  Dim resps = ss.Result
  Dim resultse = JsonConvert.SerializeObject(resps.ToString())
  End If
  
  Catch ex As HttpRequestException
  End Try
  
  Return dto
  End Sub
  End Class
```

{% endtab %}

{% tab title="PHP" %}

<pre class="language-php"><code class="lang-php">&#x3C;?php
<strong>// store order id
</strong>$order = 12 xxxx;
// referenceID must be 15 digit unique number
$referenceID = mt_rand(100000000000000, 999999999999999); 
$timestamp = date( "y-m-d H:m:s t" );
$userReference = 0;
$amount = 1;
$authKey = 'Your Authorization Key';
$merchantID = 'Your Merchent Key';
$currency = 'KWD';
$paymentMethodCode = 'All';
$sourceCurrency = "";
$doConvert = 'N';
$tunnel='';
$description='';
$datatocomputeHash = ( float )$amount . $authKey . $currency . $merchantID . $paymentMethodCode .(int)$referenceID . $sourceCurrency . $timestamp . $tunnel . (int)$userReference;
// convert the concated string in to hash and convert all string in upper character.  
$hash = strtoupper(hash_hmac("sha256", $datatocomputeHash, "Your Secret Key"));
$data = array(
  'merchantCode' => $merchantID,
  'authKey' => $authKey,
  'currency' => $currency,
  'pc' => $paymentMethodCode,
  'tunnel' => $tunnel,
  'amount' => ( float )$amount,
  'doConvert' => $doConvert,
  'sourceCurrency' => $sourceCurrency,
  'description' => $description,
  'referenceID' => (int)$referenceID,
  'timeStamp' => $timestamp,
  'language' => 'en',
  'callbackURL' => 'https://www.example.com',
  'hash' => $hash,
  'userReference' => ( int )$userReference,
  'billingDetails' => array(
    'fName' => 'First Name',
    'lName' => 'Last Name',
    'mobile' => '0000000000',
    'email' => 'abcd@gmail.com',
    'city' => 'city',
    'pincode' => '000000',
    'state' => 'State',
    'address1' => 'Address 1',
    'address2' => 'Address 2'
  ),
);
$request = json_encode( $data, true );
 
  $curl = curl_init('Your End Point' );
 
curl_setopt( $curl, CURLOPT_POST, true );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $request );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type:application/json' ) );
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
$ch = curl_exec( $curl );
curl_close( $curl );
$errno = curl_errno($curl);
  $err = curl_error($curl);
curl_close($curl);
	if(!$ch || strlen(trim($ch)) == 0)
	{
       if ($errno) {
            print "cURL Error #:" . $err;
        } 
    }
	else
	{		
		$response = json_decode($ch, true);
		if( $response["errorCode"]===0)
		{
		echo $response["result"]['redirectURL'];
			header("Location: " .$response["result"]['redirectURL']); 
			exit;
		}
		else{
			echo $response["errorMessgae"]
		}
	}
?>
</code></pre>

{% endtab %}

{% tab title="TypeScript" %}

```typescript
pagecode:` public async Task> ValidatePayment(ValidatePaymentRequest obj)
  {
  Output dto = new Output();
  var url = {Provided End Point};
  var client = new HttpClient();
  client.BaseAddress = new Uri(url);
  try
  {
  obj.hash = ComputeHash(obj);
  var resultser = JsonConvert.SerializeObject(obj);
  client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
  var response = client.PostAsJsonAsync(url, obj).Result;
  if (response.IsSuccessStatusCode)
  {
  var ss = response.Content.ReadAsStringAsync();
  var result = JsonConvert.DeserializeObject>(ss.Result);
  dto = result;
  }
  else
  {
  var ss = response.Content.ReadAsStringAsync();
  var resps = ss.Result;
  var resultse = JsonConvert.SerializeObject(resps.ToString());
  
  }
  }
  catch (HttpRequestException ex)
  {
  
  }
  
  return dto;
  
  }`;
```

{% endtab %}
{% endtabs %}

###


# 2. Redirect to Payment URL

Once you got success in Step 1, then you need redirect to the Payment URL.

```
If Response.errorCode is 0 
then 
redirect to result.redirectURL
else
log Response.errorMessgae
```


# 3. Callback To Merchant Portal

### CallBack/ Response URL

```
<YourCallBackURL>?trackid=xxxx&result=xxxx&refid=&errormessage=&Hash=xxxx
```

### **Call Back Response Parameters**

| **Parameters**  | Data Type | Description                                                                             |
| --------------- | --------- | --------------------------------------------------------------------------------------- |
| `trackid`       | string    | Reference ID passed in the request.                                                     |
| `result`        | string    | <p>Payment result.<br>Example: CAPTURED, NOT CAPTURED, DECLINED, REJECTED, BLOCKED.</p> |
| `refid`         | string    | Payment Reference Number.                                                               |
| `error message` | string    | If result is other than CAPTURED, then it gives you the actual reason.                  |
| `hash`          | string    | Use this for integrity of the data explained in response integrity section              |

### How to identify parameters that are tampered?

If you want to check whether the parameters tamper or not, convert below parameters into a hash and compare with your hash which you got as a response in a query string.

Use the below method to identify parameter tempering. &#x20;

```
  String outParams = $"trackid={trackid}&result={result}&refid={refid}";
  String outhashValue = GetHashValue(outParams,_key);
  if (Hash != outhashValue)
  {
  //This means it is tampered
  // Your code
  }
  else{
  }
```


# 4. Compute HASH

### Hashing Methods

The parameter tampering attack is based on the manipulation of parameters exchanged between client and server in order to modify application data, such as user credentials, amount and quantity of products, etc.&#x20;

{% tabs %}
{% tab title="C#" %}

```csharp
public string ComputeHash(Request _req)
  {
  string _key= { Secret Key Provided by Casheer}
  string datatocomputeHash = $"{_req.amount}{_req.authKey}{_req.currency}{_req.merchantCode}{_req.pc}{_req.referenceID}{_req.sourceCurrency}{_req.timeStamp}{_req.tunnel}{_req.userReference}";
  return GetHashValue(datatocomputeHash, _key);
  }
  public string  GetHashValue(String datatocomputeHash, String HashKey)
  {
  HMACSHA256 hmac = new HMACSHA256(System.Text.Encoding.UTF8.GetBytes(HashKey));
  string computedHash = convertToHex(hmac.ComputeHash(System.Text.UTF8Encoding.Default.GetBytes(datatocomputeHash)));
  return computedHash;
  }
  private string convertToHex(byte[] data)
  {
  System.Text.StringBuilder sb = new System.Text.StringBuilder(data.Length);
  foreach (byte b in data)
  sb.AppendFormat("{0:X2}", (int)b);
  
  return sb.ToString();
  }
```

{% endtab %}

{% tab title="VB.Net" %}

```aspnet
Private Function ComputeHash(ByVal _req As Request) As String
  Dim _key As Strig={ Secret Key Provided by Casheer}
  Dim datatocomputeHash As String = $"{_req.amount}{_req.authKey}{_req.currency}{_req.merchantCode}{_req.pc}{_req.referenceID}{_req.sourceCurrency}{_req.timeStamp}{_req.tunnel}{_req.userReference}"
  Return GetHashValue(datatoHash, _key)
  End Function
  
  Public Function GetHashValue(ByVal datatocomputeHash As String, ByVal HashKey As String) As String
  Dim hmac As HMACSHA256 = New HMACSHA256(System.Text.Encoding.UTF8.GetBytes(HashKey))
  Dim computedHash As String = convertToHex(hmac.ComputeHash(System.Text.UTF8Encoding.[Default].GetBytes(datatocomputeHash)))
  Return computedHash
  End Function
  
  Private Function convertToHex(ByVal data As Byte()) As String
  Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder(data.Length)
  For Each b As Byte In data
  sb.AppendFormat("{0:X2}", CInt(b))
  Next
  Return sb.ToString()
  End Function
```

{% endtab %}

{% tab title="PHP" %}

```php
private function ComputeHash(Request $req)
{
$_key= {Secret Key Provided by Casheer}
$datatocomputeHash = $_req.amount.$_req.authKey.$_req.currency.$_req.merchantCode.$_req.pc.$_req.referenceID.$_req.sourceCurrency.$_req.timeStamp.$_req.tunnel.$_req.userReference;
return GetHashValue($datatocomputeHash, $_key);
}
public function GetHashValue($datatocomputeHash,$HashKey)
{
$computedHash = strtoupper(hash_hmac("sha256", $datatocomputeHash,$HashKey));
return $computedHash
}
```

{% endtab %}

{% tab title="TypeScript" %}

```
private ComputeHash(_req: Request): string {
  let _key={ Secret Key Provided by Casheer}
  let datatocomputeHash: string = "{_req.amount}{_req.authKey}{_req.currency}{_req.merchantCode}{_req.pc}{_req.referenceID}{_req.sourceCurrency}{_req.timeStamp}{_req.tunnel}{_req.userReference}";
  return GetHashValue(datatocomputeHash, _key);
  }
  
  public GetHashValue(datatocomputeHash: String, HashKey: String): string {
  let hmac: HMACSHA256 = new HMACSHA256(System.Text.Encoding.UTF8.GetBytes(HashKey));
  let computedHash: string = convertToHex(hmac.ComputeHash(System.Text.UTF8Encoding.Default.GetBytes(datatocomputeHash)));
  return computedHash;
  }
  
  pagecode:`	private string convertToHex(byte[] data)
  {
  System.Text.StringBuilder sb = new System.Text.StringBuilder(data.Length);
  foreach (byte b in data)
  sb.AppendFormat("{0:X2}", (int)b);
  
  return sb.ToString();
  }`;
```

{% endtab %}
{% endtabs %}

### SubVendor Hash Method

To ensure secure processing and prevent parameter tampering attacks, it is mandatory to generate a **hash for each sub-vendor** included in the `SubVendors` array within the request body. This hash must be created using the respective sub-vendor's details and secured using the main merchant's `Authkey`. The generated hash should be included in the request to verify the integrity and authenticity of each sub-vendor's data. Failure to include a valid hash for each sub-vendor may result in the rejection of the multivendor payment request.

Below is the code sample to create sub nvedor hash

{% tabs %}
{% tab title="C#" %}

```csharp
public string ComputeSubvendorHash(SubVendor _subvendor ,Request _req)
  {
  string _key= {Main merchant Secret Key Provided by Casheer}
  string datatocomputeHash = $"{_subvendor.amount}{_subvendor.id}{_subvendor.vendorrefrence}{_req.timeStamp}";
  return GetHashValue(datatocomputeHash, _key);
  }
  public string  GetHashValue(String datatocomputeHash, String HashKey)
  {
  HMACSHA256 hmac = new HMACSHA256(System.Text.Encoding.UTF8.GetBytes(HashKey));
  string computedHash = convertToHex(hmac.ComputeHash(System.Text.UTF8Encoding.Default.GetBytes(datatocomputeHash)));
  return computedHash;
  }
  private string convertToHex(byte[] data)
  {
  System.Text.StringBuilder sb = new System.Text.StringBuilder(data.Length);
  foreach (byte b in data)
  sb.AppendFormat("{0:X2}", (int)b);
  
  return sb.ToString();
  }
```

{% endtab %}

{% tab title="VB.Net" %}

```vbnet
Private Function ComputeSubvendorHash(ByVal _subvendor As SubVendor,ByVal _req As Request) As String
  Dim _key As Strig={ Main merchant Secret Key Provided by Casheer}
  Dim datatocomputeHash As String = $"{_subvendor.amount}{_subvendor.id}{_subvendor.vendorrefrence}{_req.timeStamp}"
  Return GetHashValue(datatoHash, _key)
  End Function
  
  Public Function GetHashValue(ByVal datatocomputeHash As String, ByVal HashKey As String) As String
  Dim hmac As HMACSHA256 = New HMACSHA256(System.Text.Encoding.UTF8.GetBytes(HashKey))
  Dim computedHash As String = convertToHex(hmac.ComputeHash(System.Text.UTF8Encoding.[Default].GetBytes(datatocomputeHash)))
  Return computedHash
  End Function
  
  Private Function convertToHex(ByVal data As Byte()) As String
  Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder(data.Length)
  For Each b As Byte In data
  sb.AppendFormat("{0:X2}", CInt(b))
  Next
  Return sb.ToString()
  End Function
```

{% endtab %}

{% tab title="PHP" %}

```php
private function ComputeHash(SubVendor $_subvendor,Request $req)
{
$_key= {Main merchant Secret Key Provided by Casheer}
$datatocomputeHash = $_subvendor.amount.$_subvendor.id.$_subvendor.vendorrefrence.$_req.timeStamp;
return GetHashValue($datatocomputeHash, $_key);
}
public function GetHashValue($datatocomputeHash,$HashKey)
{
$computedHash = strtoupper(hash_hmac("sha256", $datatocomputeHash,$HashKey));
return $computedHash
}
```

{% endtab %}
{% endtabs %}


# 5. Refund Request

API to request the refund for the paid transactions.

## API Endpoints

{% tabs %}
{% tab title="Production" %}

```
Base URL /api/GenToken/Refund
```

{% endtab %}

{% tab title="Sand box" %}

```
Sandbox Base URL /api/GenToken/Refund
```

{% endtab %}
{% endtabs %}

### Sample Request & Response

{% tabs %}
{% tab title="Sample Request" %}

```html
{
    "merchantCode":"xxxxx",
    "authKey":"xxxxxxxxx",
    "ReferenceID":"(15 digit number passing during the payment creation)",
    "hash":"ComputedHash(To be calculated as described below)",
    "Amount":1,
    "Description":"optional",
    "RequestedBy":"optional"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```
{
    "errorCode": 0 is Success 1 is Failed,
    "errorMessgae": "Message",
    "Result":
    {
    "IsRefunded":"1 is refunded | 2 is under process | 0 is rejected"
    }
}
```

{% endtab %}
{% endtabs %}

### Hash Creation

use the below string format to generate a hash value using Hashing Key.

Amount+AuthenticationKey+MerchantCode+ReferenceID

### Response Parameters

| Parameters           | Data Type | Description                                                   |
| -------------------- | --------- | ------------------------------------------------------------- |
| errorCode            | Integer   | 0 is success 1 is failed and 2 is initiated for manual refund |
| errorMessagee        | String    |                                                               |
| result -> isRefunded | Integer   | 1 is refunded \| 2 is under process \| 0 is rejected          |

Merchant will receive an Email from OG regarding the updates (under process cancelled and refunded) of refund

#### Sample Code to post data

{% tabs %}
{% tab title="C#" %}

```
public async Task> RefundPayment(RefundPaymentRequest obj)
  {
  Output dto = new Output();
  var url = {Provided End Point};
  var client = new HttpClient();
  client.BaseAddress = new Uri(url);
  try
  {
  obj.hash = ComputeHash(obj);
  var resultser = JsonConvert.SerializeObject(obj);
  client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
  var response = client.PostAsJsonAsync(url, obj).Result;
  if (response.IsSuccessStatusCode)
  {
  var ss = response.Content.ReadAsStringAsync();
  var result = JsonConvert.DeserializeObject>(ss.Result);
  dto = result;
  }
  else
  {
  var ss = response.Content.ReadAsStringAsync();
  var resps = ss.Result.ToString();
  }
  }
  catch (HttpRequestException ex)
  {
  }
  return dto;
  }
```

{% endtab %}

{% tab title="VB.NET" %}

```
 Class SurroundingClass
  Public Task As async
  
  Private Sub New(ByVal obj As RefundPaymentRequest )
  Dim dto As Output = New Output()
  Dim url = {Provided End Point};
  Dim client = New HttpClient()
  client.BaseAddress = New Uri(url)
  
  Try
  obj.hash = ComputeHash(obj)
  Dim resultser = JsonConvert.SerializeObject(obj)
  client.DefaultRequestHeaders.Accept.Add(New System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"))
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8")
  Dim response = client.PostAsJsonAsync(url, obj).Result
  
  If response.IsSuccessStatusCode Then
  Dim ss = response.Content.ReadAsStringAsync()
  Dim result = JsonConvert.DeserializeObject > (ss.Result)
  dto = result
  Else
  Dim ss = response.Content.ReadAsStringAsync()
  Dim resps = ss.Result
  Dim resultse = JsonConvert.SerializeObject(resps.ToString())
  End If
  
  Catch ex As HttpRequestException
  End Try
  
  Return dto
  End Sub
  End Class
```

{% endtab %}

{% tab title="PHP" %}

```
<?php

// referenceID must be 15 digit Payment Number
$referenceID = 123456412250000;

$amount = 20.50;
$authKey = 'Your Authorization Key';
$merchantID = 'Your Merchent Key';
// Concat all data string 
$datatocomputeHash = ( float )$amount . $authKey  . $merchantID . $referenceID ;
// convert the concated string in to hash and convert all string in upper character. 
$hash = strtoupper( hash_hmac( "sha256", $datatocomputeHash, $secretkey ) );
$data = array(
  'merchantCode' => $merchantID,
  'authKey' => $authKey,
  'hash' => $hash
  'amount' => ( float )$amount,
  'description' => $description,
  'RequestedBy' => $RequestedBy,
);
$request = json_encode( $data, true );
if ( !$endpoint ) {
  $curl = curl_init( 'Provided End Point' );
} else {
  $curl = curl_init( $endpoint );
}
curl_setopt( $curl, CURLOPT_POST, true );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $request );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type:application/json' ) );
$ch = curl_exec( $curl );
curl_close( $curl );
$response = json_decode( $ch, true );
?>
```

{% endtab %}

{% tab title="TypeScript" %}

```
pagecode:` public async Task> RefundRequest(RefundPaymentRequest obj)
  {
  Output dto = new Output();
  var url = {Provided End Point};
  var client = new HttpClient();
  client.BaseAddress = new Uri(url);
  try
  {
  obj.hash = ComputeHash(obj);
  var resultser = JsonConvert.SerializeObject(obj);
  client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
  var response = client.PostAsJsonAsync(url, obj).Result;
  if (response.IsSuccessStatusCode)
  {
  var ss = response.Content.ReadAsStringAsync();
  var result = JsonConvert.DeserializeObject>(ss.Result);
  dto = result;
  }
  else
  {
  var ss = response.Content.ReadAsStringAsync();
  var resps = ss.Result;
  var resultse = JsonConvert.SerializeObject(resps.ToString());
  
  }
  }
  catch (HttpRequestException ex)
  {
  
  }
  
  return dto;
  
  }`;
```

{% endtab %}
{% endtabs %}


# 6, Payment Status

API to get the status of a payment

### API Endpoints

{% tabs %}
{% tab title="Production" %}

```
Production Base URL /api/GenToken/GetStatus
```

{% endtab %}

{% tab title="Sandbox" %}

```
Sandbox Base URL /api/GenToken/GetStatus
```

{% endtab %}
{% endtabs %}

### Sample Request & Response

{% tabs %}
{% tab title="Sample Request" %}

```
{
    "merchantCode":"xxxxx",
    "authKey":"xxxxx",
    "ReferenceID":"(15 digit number passing during the payment creation)"


```

{% endtab %}

{% tab title="Sample Response for Captured" %}

```
{
  "errorCode": 0,
  "errorMessgae": "",
  "result": {
    "tranDate": 260125,
    "referenceID": 479865896769733,
    "amount": 10,
    "charges": 0.25,
    "paidAmount": 10,
    "countryCode": "KW",
    "currencyCode": "KWD",
    "paymentChannelCode": "KWKNETDCCORE",
    "tunnel": "kibtest",
    "authCode": "B30286",
    "transactionID": "502610000474188",
    "refID": "502610000300",
    "paymentID": "100502610000004439",
    "result": "CAPTURED",
    "status": 1,
    "merchantRef": null,
    "transactionDate": "2025-01-26T12:01:55.4101568",
    "processedDate": "2025-01-26T12:02:36.7615293",
    "mobile": "0",
    "email": null,
    "response": "REFUNDED",
    "info1": "USA",
    "info2": null,
    "info3": null,
    "settlementDate": null,
    "settledDate": null,
    "settledBy": null,
    "isRefunded": true,
    "refundAmount": 10,
    "refundedOn": "2025-01-26T12:03:38.637",
    "refundRefrence": null,
    "commissionAmnt": null,
    "serviceAmount": null,
    "merchantName": null,
    "originalAmount": null,
    "commissionDetails": null,
    "vat": null,
    "vatAmount": null,
    "finalCommission": null
  }
}
```

{% endtab %}

{% tab title="Sample Response for Not captured" %}

```
{
  "errorCode": 0,
  "errorMessgae": "",
  "result": {
    "tranDate": 260125,
    "referenceID": 762532132798579,
    "amount": 0.01,
    "charges": 0,
    "paidAmount": 0.01,
    "countryCode": "KW",
    "currencyCode": "KWD",
    "paymentChannelCode": "KWKFHMPGSCCKWD",
    "tunnel": "nbklocal",
    "authCode": null,
    "transactionID": null,
    "refID": null,
    "paymentID": "b394481c3e4c4254",
    "result": "NOT CAPTURED",
    "status": 2,
    "merchantRef": "SESSION0002044905074I70319456L0",
    "transactionDate": "2025-01-26T12:08:14.0891371",
    "processedDate": "2025-01-26T13:54:22.0071249+03:00",
    "mobile": "0",
    "email": null,
    "response": "INVALID_REQUEST||Unable+to+find+order+762532132798579+for+merchant+900484001",
    "info1": "en_US",
    "info2": null,
    "info3": "////",
    "settlementDate": null,
    "settledDate": null,
    "settledBy": null,
    "isRefunded": null,
    "refundAmount": null,
    "refundedOn": null,
    "refundRefrence": null,
    "commissionAmnt": null,
    "serviceAmount": null,
    "merchantName": null,
    "originalAmount": null,
    "commissionDetails": null,
    "vat": null,
    "vatAmount": null,
    "finalCommission": null
  }
}
```

{% endtab %}

{% tab title="Sample response for exception" %}

```
{
  "errorCode": 1,
  "errorMessgae": "Transaction not found at OG.",
  "result": {
    "tranDate": null,
    "referenceID": null,
    "amount": null,
    "charges": null,
    "paidAmount": null,
    "countryCode": null,
    "currencyCode": null,
    "paymentChannelCode": null,
    "tunnel": null,
    "authCode": null,
    "transactionID": null,
    "refID": null,
    "paymentID": null,
    "result": null,
    "status": null,
    "merchantRef": null,
    "transactionDate": null,
    "processedDate": null,
    "mobile": null,
    "email": null,
    "response": null,
    "info1": null,
    "info2": null,
    "info3": null,
    "settlementDate": null,
    "settledDate": null,
    "settledBy": null,
    "isRefunded": null,
    "refundAmount": null,
    "refundedOn": null,
    "refundRefrence": null,
    "commissionAmnt": null,
    "serviceAmount": null,
    "merchantName": null,
    "originalAmount": null,
    "commissionDetails": null,
    "vat": null,
    "vatAmount": null,
    "finalCommission": null
  }
}
```

{% endtab %}
{% endtabs %}

#### Response Explanation

If errorCode is not "0" then check errorMessage for more details.&#x20;

If errorCode is "0" then only check for Result object.

### Response Parameters

<table><thead><tr><th width="237">Parameters</th><th>Datatype</th><th>Description</th></tr></thead><tbody><tr><td>RefrenceId</td><td>Long</td><td>15-digit unique transaction number</td></tr><tr><td>Amount</td><td>decimal</td><td>Amount of transaction</td></tr><tr><td>tranDate</td><td>Integer </td><td>date of the transaction in (DDMMYY)</td></tr><tr><td>result</td><td>string</td><td>show the result of the transaction (CANCELED or CAPTURED)</td></tr><tr><td>isRefunded</td><td>bool(nullable)</td><td>true if refunded</td></tr></tbody></table>

### Sample Code to post data

{% tabs %}
{% tab title="C#" %}

```
public async Task> CheckPaymentStatus(PaymentStatus obj)
  {
  Output dto = new Output();
  var url = {Provided End Point};
  var client = new HttpClient();
  client.BaseAddress = new Uri(url);
  try
  {
  var resultser = JsonConvert.SerializeObject(obj);
  client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
  var response = client.PostAsJsonAsync(url, obj).Result;
  if (response.IsSuccessStatusCode)
  {
  var ss = response.Content.ReadAsStringAsync();
  var result = JsonConvert.DeserializeObject>(ss.Result);
  dto = result;
  }
  else
  {
  var ss = response.Content.ReadAsStringAsync();
  var resps = ss.Result.ToString();
  }
  }
  catch (HttpRequestException ex)
  {
  }
  return dto;
  }
```

{% endtab %}

{% tab title="VB.NET" %}

```
Class SurroundingClass
  Public Task As async
  
  Private Sub New(ByVal obj As PaymentStatus )
  Dim dto As Output = New Output()
  Dim url = {Provided End Point};
  Dim client = New HttpClient()
  client.BaseAddress = New Uri(url)
  
  Try
  Dim resultser = JsonConvert.SerializeObject(obj)
  client.DefaultRequestHeaders.Accept.Add(New System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"))
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8")
  Dim response = client.PostAsJsonAsync(url, obj).Result
  
  If response.IsSuccessStatusCode Then
  Dim ss = response.Content.ReadAsStringAsync()
  Dim result = JsonConvert.DeserializeObject > (ss.Result)
  dto = result
  Else
  Dim ss = response.Content.ReadAsStringAsync()
  Dim resps = ss.Result
  Dim resultse = JsonConvert.SerializeObject(resps.ToString())
  End If
  
  Catch ex As HttpRequestException
  End Try
  
  Return dto
  End Sub
  End Class
```

{% endtab %}

{% tab title="PHP" %}

```
<?php

// referenceID must be 15 digit Payment Number
$referenceID = 123456412250000;
$authKey = 'Your Authorization Key';
$merchantID = 'Your Merchent Key';
$data = array(
  'merchantCode' => $merchantID,
  'authKey' => $authKey,
  'referenceID' => $referenceID,
);
$request = json_encode( $data, true );
if ( !$endpoint ) {
  $curl = curl_init( 'Provided End Point' );
} else {
  $curl = curl_init( $endpoint );
}
curl_setopt( $curl, CURLOPT_POST, true );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $request );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type:application/json' ) );
$ch = curl_exec( $curl );
curl_close( $curl );
$response = json_decode( $ch, true );
?>
```

{% endtab %}

{% tab title="Typescript" %}

```
pagecode:` public async Task> PaymentStatus(PaymentStatus obj)
  {
  Output dto = new Output();
  var url = {Provided End Point};
  var client = new HttpClient();
  client.BaseAddress = new Uri(url);
  try
  {
  var resultser = JsonConvert.SerializeObject(obj);
  client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
  var response = client.PostAsJsonAsync(url, obj).Result;
  if (response.IsSuccessStatusCode)
  {
  var ss = response.Content.ReadAsStringAsync();
  var result = JsonConvert.DeserializeObject>(ss.Result);
  dto = result;
  }
  else
  {
  var ss = response.Content.ReadAsStringAsync();
  var resps = ss.Result;
  var resultse = JsonConvert.SerializeObject(resps.ToString());
  
  }
  }
  catch (HttpRequestException ex)
  {
  
  }
  
  return dto;
  
  }`;
```

{% endtab %}
{% endtabs %}


# Parameters & Description

### Parameters

| Parameters Name      | Data Types | Required    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------------- | ---------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`merchantCode`**   | `string`   | Yes         | <p>Provided by Casheer</p><p><code>Ex: KW23281</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **`authKey`**        | `string`   | Yes         | <p>Provided by Casheer</p><p><code>Ex: eaOZH3MnSslWexl</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **`currency`**       | `string`   | Yes         | Refer "[Payment Channels](/payment-methods)" Table.`( KWD, BHD, USD, EGP, SAR, GBP, EUR, etc.)`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **`pc`**             | `string`   | Yes         | <p>a) For specific payment method, pass that particular payment method <a href="/pages/-MDWJKQbNeFydI2_nCpg">code</a>.</p><p><code>Ex: KWKNETDC for KNET</code></p><p>    <code>BHBENEFITDC for Benefit</code></p><p>    <code>EGUPGCC for Meeza</code></p><p>b) To show all payment methods use the code <code>"all".</code></p><p><code>Ex: all</code></p><p>c) For specific country payment methods, use the code <code>"currency"</code> </p><p>and the pass desired country's standard three letter currency code in <strong>currency parameter.</strong></p><p><code>Ex: currency</code></p><p></p> |
| **`tunnel`**         | `string`   | Optional    | Provided by Casheer  if requires.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **`amount`**         | `double`   | Yes         | Your customer transaction amount. `Ex:1,1.25,1.5`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **`doConvert`**      | `string`   | Yes         | When the amount needs to be converted to other currency, then the value should be **"Y"**, else **"N"**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **`sourceCurrency`** | `string`   | Conditional | <p>When the amount needs to be converted the other currency, then pass standard three letter currency code. <code>( KWD, BHD, USD, EGP, SAR, GBP, EUR, etc.)</code> </p><p><code>Ex: If Amount to be converted from USD to KWD, then doConvert=Y and sourceCurrency=USD</code></p>                                                                                                                                                                                                                                                                                                                        |
| **`description`**    | `string`   | Optional    | Your product/item name or description.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **`referenceID`**    | `long`     | Yes         | <p>Must be 15 digits unique number. </p><p><code>Ex: 123456789012345</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **`timeStamp`**      | `string`   | Yes         | <p>Current Date & Time when the payment's URL generating. </p><p><code>Ex: 202101241619123</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **`language`**       | `string`   | Optional    | English (en) / Arabic (ar)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **`callbackURL`**    | `string`   | Yes         | <p>Once the transaction is completed, the customer will be redirected to the given response URL. </p><p><code>Ex: <https://yourdomain.com/Calback></code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **`userreference`**  | long       | Conditional | <p>Your customer's mobile number or any unique number (minimum 8 digits and maximum 15 digits) for <strong>Quick Pay</strong> service. </p><p>Example: KFAST for KNET</p><p>Which the customer can save their card(s) details, enabling them to carry out any future transactions with the same merchant, in a speedy manner, by only having to enter their PIN when prompted. </p><p>Note: <strong>Quick Pay</strong> service should be enabled for the merchant by Casheer, in order to use this service. </p><p><code>Ex: 12345678</code></p>                                                          |
| **`hash`**           | `string`   | Yes         | <p>Please refer <a href="/pages/-MDkCmoALkGYZweIj84M">here</a>. </p><p><code>Ex: B400HJKHKJ00000JKHJKHKJJK032321JKHFJKHF</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **`BillingDetails`** |            |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **`fName`**          | `string`   | Optional    | Your customer's First Name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **`lName`**          | `string`   | Optional    | Your customer's Last Name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **`mobile`**         | `string`   | Optional    | You customer's Mobile Number.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **`email`**          | `string`   | Optional    | Your customer's Email.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **`city`**           | `string`   | Optional    | Your customer's Shipping City.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **`pincode`**        | `string`   | Optional    | Your customer's Postal/Zip Code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **`state`**          | `string`   | Optional    | Your customer's Billing State.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **`address1`**       | `string`   | Optional    | Your customer's Billing Address.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **`address2`**       | `string`   | Optional    | Your customer's Billing Address.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

###

|   |
| - |


# Payment Methods

| Country    | Country Code | Payment Channels                                         | Payment Code                                        | Currency Code                  |
| ---------- | ------------ | -------------------------------------------------------- | --------------------------------------------------- | ------------------------------ |
| **Kuwait** | `KW`         | <p>KNET</p><p>VISA/MasterCard</p><p>American Express</p> | <p>KWKNETDC</p><p>KWKFHMPGSCCKWD</p><p>KWAMEXCC</p> | <p>KWD</p><p>KWD</p><p>KWD</p> |
| **Egypt**  | `EG`         | <p>VISA/MasterCard( Misr Bank)</p><p>Meeza</p>           | <p>EGMISRMPGS</p><p></p><p>EGUPGCC</p>              | <p>EGP</p><p></p><p>EGP</p>    |
| **USA**    | `US`         | VISA/MasterCard                                          | KWKFHMPGSCCUSD                                      | USD                            |


# Test Cards

Test your integration

Please use the following test card number to simulate the charging process as your customer.

### Card Details

| Card Name                   | Card Number                                              | Expiry Date (mm/yy)                                    | CVV/PIN           |
| --------------------------- | -------------------------------------------------------- | ------------------------------------------------------ | ----------------- |
| **Master**                  | <p>5123450000000008<br>2223000000000007</p>              | <p>01 / 39<br>01 / 39</p>                              | <p>100<br>100</p> |
| **VISA**                    | <p>4508750015741019<br>4012000033330026</p>              | <p>01 / 39<br>01 / 39</p>                              | <p>100<br>100</p> |
| **KNET**                    | <p>8888880000000001 </p><p>8888880000000009 (KFAST) </p> | <p>09 / 30</p><p>Any Other value for "NOT CAPTUED"</p> | 1234              |
| **American Express (Amex)** | 345678901234564                                          | 01 / 39                                                | 1000              |

### Expiry Dates

Please use the following expiry dates to simulate the different Transaction responses for Credit Cards only.

| **Expiry Date** | **Transaction Response Gateway Code** |
| --------------- | ------------------------------------- |
| 01 / 39         | APPROVED                              |
| 05 / 22         | DECLINED                              |
| 04 / 27         | EXPIRED\_CARD                         |
| 08 / 28         | TIMED\_OUT                            |
| 01 / 37         | ACQUIRER\_SYSTEM\_ERROR               |
| 02 / 37         | UNSPECIFIED\_FAILURE                  |
| 05 / 37         | UNKNOWN                               |

### CSC/CVV

| CSC/CVV Response Gateway Code  | Status         |
| ------------------------------ | -------------- |
| 100                            | MATCH          |
| 101                            | NOT\_PROCESSED |
| 102                            | NO\_MATCH      |
| **For American Express Cards** |                |
| 1000                           | MATCH          |
| 1010                           | NOT\_PROCESSED |
| 1020                           | NO\_MATCH      |


# Download Plugins/SDK

{% hint style="info" %}
Please check out this page to download all Plugins/Apps/SDKs <https://ogbusiness.com/en/pay/developer/>
{% endhint %}


# Direct Pay


# 1. Generate Merchant Keys

A merchant should have an RSA public key in order to integrate direct pay. The RSA key will be generated using this endpoint.

API Endpoints

{% tabs %}
{% tab title="Production Endpoint" %}

```
Production Base URL /api/GenToken/GenerateMerchantKey
```

{% endtab %}

{% tab title="Sandbox Endpoint" %}

```
Sandbox Base URL /api/GenToken/GenerateMerchantKey
```

{% endtab %}
{% endtabs %}

#### **Sample Request & Response**

Use the below parameters to get merchant keys.

{% tabs %}
{% tab title="Sample Request" %}

```

{
    "merchantCode":"xxxxx",
    "authKey":"xxxxxxxxxx"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```
{
  "errorCode": 0,
  "errorMessgae": "string",
  "result": {
    "publicKey": "string"
  }
}
```

{% endtab %}
{% endtabs %}

#### To obtain the public key, access the publicKey property directly from the API response object as follows:       &#xD;

```
var publicKey = response.result.publicKey;
```

In the event that an error occurs while retrieving or using response.result.publicKey (e.g., the property is malformed, or inaccessible), implement the following fallback mechanism:                                                 **Use an RSA public key in the XML format specified below:**

```
<RSAKeyValue>
    <Modulus>[Binary value]</Modulus>
    <Exponent>AQAB</Exponent>
</RSAKeyValue>
```

&#x20;Replace \[Binary value] with the base64-encoded modulus of the RSA public key. This is the primary component of the key.

### &#x20;sample code to post data

{% tabs %}
{% tab title="C#" %}

```
 public async Task> GenrateKeys(GenrateKeysRequest obj)
  {
  Output dto = new Output();
  var url = {Provided End Point};
  var client = new HttpClient();
  client.BaseAddress = new Uri(url);
  try
  {
  var resultser = JsonConvert.SerializeObject(obj);
  client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
  var response = client.PostAsJsonAsync(url, obj).Result;
  if (response.IsSuccessStatusCode)
  {
  var ss = response.Content.ReadAsStringAsync();
  var result = JsonConvert.DeserializeObject>(ss.Result);
  dto = result;
  }
  else
  {
  var ss = response.Content.ReadAsStringAsync();
  var resps = ss.Result.ToString();
  }
  }
  catch (HttpRequestException ex)
  {
  }
  return dto;
 
   }
```

{% endtab %}

{% tab title="VB. NET" %}

```
  Class SurroundingClass
  Public Task As async
  
  Private Sub New(ByVal obj As ValidatePaymentRequest)
  Dim dto As Output = New Output()
  Dim url = {Provided End Point};
  Dim client = New HttpClient()
  client.BaseAddress = New Uri(url)
  
  Try
  obj.hash = ComputeHash(obj)
  Dim resultser = JsonConvert.SerializeObject(obj)
  client.DefaultRequestHeaders.Accept.Add(New System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"))
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8")
  Dim response = client.PostAsJsonAsync(url, obj).Result
  
  If response.IsSuccessStatusCode Then
  Dim ss = response.Content.ReadAsStringAsync()
  Dim result = JsonConvert.DeserializeObject > (ss.Result)
  dto = result
  Else
  Dim ss = response.Content.ReadAsStringAsync()
  Dim resps = ss.Result
  Dim resultse = JsonConvert.SerializeObject(resps.ToString())
  End If
  
  Catch ex As HttpRequestException
  End Try
  
  Return dto
  End Sub
  End Class
```

{% endtab %}

{% tab title="PHP" %}

```

<?php
// Merchant Code
$merchantCode= xxxx;
// AuthKey
$authKey = 'Your Authorization Key';
$data = array(
  'merchantCode' => $merchantCode,
  'authKey' => $authKey,
);
$request = json_encode( $data, true );
if ( !$endpoint ) {
  $curl = curl_init( { Provided Url } );
} else {
  $curl = curl_init( $endpoint );
}
curl_setopt( $curl, CURLOPT_POST, true );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $request );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type:application/json' ) );
$ch = curl_exec( $curl );
curl_close( $curl );
$response = json_decode( $ch, true );
?>
```

{% endtab %}

{% tab title="Typescript" %}

```

pagecode:` public async Task> GenrateKeys(GenrateKeysRequest obj)
  {
  Output dto = new Output();
  var url = {Provided End Point};
  var client = new HttpClient();
  client.BaseAddress = new Uri(url);
  try
  {
  var resultser = JsonConvert.SerializeObject(obj);
  client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json; charset=utf-8");
  var response = client.PostAsJsonAsync(url, obj).Result;
  if (response.IsSuccessStatusCode)
  {
  var ss = response.Content.ReadAsStringAsync();
  var result = JsonConvert.DeserializeObject>(ss.Result);
  dto = result;
  }
  else
  {
  var ss = response.Content.ReadAsStringAsync();
  var resps = ss.Result;
  var resultse = JsonConvert.SerializeObject(resps.ToString());
  
  }
  }
  catch (HttpRequestException ex)
  {
  
  }
  
  return dto;
  
  }`;
```

{% endtab %}
{% endtabs %}

**Note**: Merchant keys are valid for 24 hours and the same key to be use for decryption for 24 hours. Users are expected to generate a new merchant key every 24 hours. If the merchant utilizes an invalid RSA public key, the following error will show up in subsequent calls. { "ErrorMessage" : "Exception while decrypting the Card Details" }


# 2. Validate Request

### API Endpoints

{% tabs %}
{% tab title="Production Endpoint" %}

```
Production Base URL /api/GenToken/Validate
```

{% endtab %}

{% tab title="Sandbox Endpoint" %}

```
Sandbox Base URL /api/GenToken/Validate
```

{% endtab %}
{% endtabs %}

#### **Sample Request & Response**

Use the below parameters and hashing function for order creation. The request should contain the following inputs to make sure inputs should be encrypted using our hashing function show in the following example to prevent exposure. For parameters description please refer [here](/parameters-and-description)

{% tabs %}
{% tab title="Sample Request" %}

```
  {
  "merchantCode": "xxxxx",
  "authKey": "xxxxxxxxx",
  "currency": "KWD",   
  "pc": "DIRECTPAY",  
  "tunnel": "",    
  "amount": 1 ,   
  "doConvert": "N",
  "sourceCurrency":"conditional",
  "description": "optional",
  "referenceID": "(15 digit random number)",     
  "timeStamp": "yyyy/MM/dd HH:mm:ss tt",
  "language": "en",
  "callbackURL": "Your website URL",
  "hash": "ComputedHash",  
  "userReference": 0,   
  "billingDetails": 
  {
  "fName": "First Name",
  "lName": "last Name",
  "mobile": "mobile",
  "email": "email",
  "city": "city",
  "pincode": "pincode",
  "state": "state", // ISD code for state/region
  "address1": "address1",
  "address2": "address2",
  "country":"KW" // ISD Two letter country code 
  }
}
```

{% endtab %}

{% tab title="Sample Response" %}

```
   "errorCode": 0,
   "errorMessgae": "string",
   "result": 
    {
     "redirectURL": "string",
     "tokenID": "string",    
     "orderAmount": 0,
     "paidAmount": 0,
     "serviceAmount": 0,
     "commissionAmount": 0,   
     "originalAmount": "string"
    }
}  
```

{% endtab %}
{% endtabs %}

Upon receiving the response, the merchant must verify the errorCode. If the errorCode is 0, the merchant should parse the result object and proceed to invoke the InitiatePay API, as detailed in the subsequent step.


# 3. Initiate Pay

Once the merchant request has been verified, this API is used to safely handle payment requests by encrypting card data using AES and RSA encryption.

#### API Endpoints

{% tabs %}
{% tab title="Production Endpoint" %}

```
https://kwpaypg.casheer.com/COFWAY/InitiatePay
```

{% endtab %}

{% tab title="Sandbox Endpoint" %}

```
https://kwpaypgsb.casheer.com/COFWAY/InitiatePay
```

{% endtab %}
{% endtabs %}

#### **Sample Request & Response**

The following fields ought to be included in the request body:

{% tabs %}
{% tab title="Sample Request" %}

```
 "Initiate pay request{
     "ReferenceId" : "xxxxxxxxx"
     "MerchantId": xxxxxx, 
     "ECardData" = "encryptedCard", 
      32BIT AES Encryption 
     "ECardKey" = "encryptedKey", 
     "ACS_CallbackURL"= "call back url for 3DS"+ReferenceId   
     }
     
 };
```

{% endtab %}

{% tab title="Sample Response" %}

```
 {
  "errorCode": 0,
  "errorMessgae": "SUCCESS",
  "result": {
    "authentication": {
      "the3Ds1": null,
      "the3Ds2": null,
      "acceptVersions": null,
      "channel": null,
      "purpose": null,
      "redirect": {
        "customized": null,
        "domainName": "ap.gateway.mastercard.com",
        "html": "<div id=\"threedsChallengeRedirect\" xmlns=\"http://www.w3.org/1999/html\" style=\"height: 100vh\"> <form id =\"threedsChallengeRedirectForm\" method=\"POST\" action=\"https://ap.gateway.mastercard.com/acs/mastercard/v2/prompt\" target=\"challengeFrame\"> <input type=\"hidden\" name=\"creq\" value=\"eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6IjNmN2E4MmVjLTEzZjYtNDg2Ni05ODVjLTlkOTgxZjIzMGQ0OSJ9\" /> </form> <iframe id=\"challengeFrame\" name=\"challengeFrame\" width=\"100%\" height=\"100%\" ></iframe> <script id=\"authenticate-payer-script\"> var e=document.getElementById(\"threedsChallengeRedirectForm\"); if (e) { e.submit(); if (e.parentNode !== null) { e.parentNode.removeChild(e); } } </script> </div>"
      },
      "redirectHtml": null,
      "version": "3DS2",
      "the3Ds": null,
      "method": "OUT_OF_BAND",
      "payerInteraction": null
    }
  }
}
```

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="175">Field Name</th><th width="86">Type</th><th>Description</th></tr></thead><tbody><tr><td>ReferenceId</td><td>String</td><td>15-digit reference id received in the validate requet response</td></tr><tr><td>MerchantId</td><td>String</td><td>Merchant code provided by PSP</td></tr><tr><td>ECardData</td><td>String</td><td>The card data encrypted using AES encryption with a 32-bit key. Explained below</td></tr><tr><td>ECardKey</td><td>String</td><td>The AES encryption key, encrypted using an RSA public key generated at <a href="#ecarddata-encryption">here</a></td></tr><tr><td>ACS_CallbackURL</td><td>String</td><td>Explained <a href="#acs_callbackurl">here</a></td></tr></tbody></table>

### Explanation of the `ECardData` Encryption Object <a href="#ecarddata-encryption" id="ecarddata-encryption"></a>

The `ECardData` field in the request is an encrypted representation of the sensitive card details. The following explains the object that is encrypted using AES encryption before being included in the API request:

```
{
    "CardNumber": "xxxxxxxxxxxxxxxx",//16-digit card number
    "CardName": "John Doe", //Name mentioned on card
    "CardExpiry": "mm/yy", //month/year format
    "CardCVV": "xxx" //3 digit number
    "CardBrand" :"001" // 001 for VISA and 002 for MASTER CARD
}
```

#### Sample code to encrypt ECardData

{% tabs %}
{% tab title="AES Encryption C#" %}

```csharp
 
string aesKeyText = "jcIkNa3ybrNVWxe1GSxycA1ru4GoEETO"; // Generate a 32bit random alphanumeric Key
byte[] aesKey = Encoding.UTF8.GetBytes(aesKeyText);
byte[] IV = new byte[16]; // 16-byte IV initialized to zeros

var cardData = new
{
    CardNumber = "XXXXXXXXXXXXXXXXX",
    CardName = "John Doe",
    CardExpiry = "MM/YY",
    CardCVV = "XXX",
    "CardBrand" :"001"
};

string serializedCardData = JsonConvert.SerializeObject(cardData);
string encryptedData = EncryptStringToBytes_Aes(serializedCardData, aesKey, IV);



public static string EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV)
{
    
    using (Aes aesAlg = Aes.Create())
    {
        aesAlg.Key = Key;
        aesAlg.IV = IV;
        aesAlg.Mode = CipherMode.CBC;
        aesAlg.Padding = PaddingMode.PKCS7;

        using (var encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV))
        using (var msEncrypt = new MemoryStream())
        {
            using (var csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))
            using (var swEncrypt = new StreamWriter(csEncrypt))
            {
                swEncrypt.Write(plainText);
            }
            return Convert.ToBase64String(msEncrypt.ToArray());
        }
    }
}

```

{% endtab %}

{% tab title="RSA Encryption C#" %}

```csharp

string aesKeyText = "jcIkNa3ybrNVWxe1GSxycA1ru4GoEETO"; //AES KEY Used to encrypt the card data
string publicKeys = "RSA Public Key"   //Previously generated merchant keys

// Encrypt the AES key using the RSA public key
string encryptedKey = RSA_Encrypt(aesKeyText, publicKeys);

public string RSA_Encrypt(string textToEncrypt, string publicKeyString)
{
    if (string.IsNullOrWhiteSpace(textToEncrypt)) throw new ArgumentNullException(nameof(textToEncrypt));
    if (string.IsNullOrWhiteSpace(publicKeyString)) throw new ArgumentNullException(nameof(publicKeyString));

    var bytesToEncrypt = Encoding.UTF8.GetBytes(textToEncrypt);

    using var rsa = new RSACryptoServiceProvider(2048);
    try
    {
        rsa.FromXmlString(publicKeyString);
        var encryptedData = rsa.Encrypt(bytesToEncrypt, true);
        return Convert.ToBase64String(encryptedData);
    }
    finally
    {
        rsa.PersistKeyInCsp = false;
    }
}


```

{% endtab %}
{% endtabs %}

### ACS\_CallbackURL

* The provider will handle the 3D Secure callback if it is empty, and the user will be sent to the callback URL that was supplied in step 1. For more info about redirection refer [here](/sample-code/3.-callback-merchant-portal).
* If provided, the 3D Secure callback will be sent to the merchant's specified URL, and the merchant must call the API at [here](/direct-pay/4.-process-payment) for further processing.

### Response Explaination

Upon receiving the response from the InitiatePay API, the merchant must verify the errorCode to determine the next steps. If the errorCode is 0, indicating a successful initiation, the merchant should parse the result object and render the HTML content provided in *<mark style="color:blue;">**result.redirect.html**</mark>* to proceed with the 3DS authentication process.


# 4. Process Payment

Use the ProcessPayment request to initiate a payment process for a given ReferenceId.

Upon completing the 3DS authentication process, the user is redirected to the endpoint specified in the Acs\_CallbackUrl parameter of the InitiatePay request. The merchant receives a response containing a form object at this endpoint. The merchant must verify that <mark style="color:blue;">**form.result**</mark> equals "SUCCESS" and <mark style="color:blue;">**form.response.gatewayRecommendation**</mark> equals "PROCEED" to determine whether to proceed with the payment process. If both conditions are satisfied, the merchant should call the ProcessPayment API with the specified parameters.

#### API Edpoints

{% tabs %}
{% tab title="Production Endpoint" %}

```
https://kwpaypg.casheer.com/COFWAY/ProcessPayment
```

{% endtab %}

{% tab title="Sandbox Endpoint" %}

```
https://kwpaypgsb.casheer.com/COFWAY/ProcessPayment   
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}

<pre class="language-html"><code class="lang-html"> {
    "ReferenceId": "xxxxxxxxxxxx",  // 15-digit reference id used in the validate request
    "MerchantId": "KW23821",        // Merchant code
     "Result": "success",             // result received in the form.result object
    "GatewayRecommendation": "PROCEED" // Gateway recommendation received in the form.result.gatewayrecommandation
<strong>}
</strong></code></pre>

{% endtab %}

{% tab title="Sample Response" %}

```

  "errorCode": 0,
  "errorMessgae": "SUCCESS",
  "result": {
    "error": null,
    "gatewayEntryPoint": "WEB_SERVICES_API",
    "merchant": "",
    "order": {
      "amount": 10,
      "certainty": null,
      "creationTime": "2025-04-23T10:27:26.416Z",
      "currency": "USD",
      "id": "543839849919125",
      "status": "CAPTURED",
      "totalAuthorizedAmount": 10,
      "totalCapturedAmount": 10,
      "totalRefundedAmount": 0,
      "authenticationStatus": "AUTHENTICATION_SUCCESSFUL",
      "lastUpdatedTime": "2025-04-23T10:27:41.733+00:00",
      "merchantCategoryCode": "5399",
      "valueTransfer": null
    },
    "response": {
      "the3DSecure": null,
      "acquirerCode": "00",
      "acquirerMessage": "Approved",
      "gatewayCode": "APPROVED",
      "gatewayRecommendation": "NO_ACTION"
    },
    "result": "SUCCESS",
    "sourceOfFunds": {
      "provided": {
        "card": {
          "brand": "MASTERCARD",
          "number": "512345xxxxxx0008",
          "securityCode": null,
          "expiry": {
            "month": "1",
            "year": "39"
          }
        }
      },
      "type": "CARD"
    },
    "timeOfRecord": "2025-04-23T13:27:41.529+03:00",
    "transaction": {
      "acquirer": {
        "batch": 20250423,
        "date": "0423",
        "id": "NBK_S2I",
        "merchantId": "900459840",
        "settlementDate": "2025-04-23T00:00:00",
        "timeZone": "+0300",
        "tra": "..."
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

Upon receiving the response from the ProcessPayment API, the merchant must verify the errorCode to determine the next steps. If the errorCode is 0, indicating a successful API call, the merchant should parse the result object and verify that result.result equals "SUCCESS" and result.response.acquirerMessage equals "APPROVED". These conditions confirm a successful payment transaction.


# WooCommerce

Integrating your WooCommerce store with Casheer Pay services allows you to accept payments on your WooCommerce store with simple installation. You can accept payments via Debit & Credit Card, & ATM Cards. The plugin offers seamless integration, allowing the customer to pay on your website with a high secure PCI compliance hosted environment and work across all browsers and ensures compatibility with the below versions of WooCommerce

### **Compatibilities and Dependencies**

* WordPress v6.9 (or) higher
* WooCommerce v10.4.3 (or) higher

{% hint style="warning" %}
Note: The plugin has been tested up to WooCommerce v10.4.3.
{% endhint %}

### Installation

There are two methods to install the Casheer Pay WooCommerce plugin

1. Install via WordPress plugin Installer
2. Install Plugins Manually through FTP

{% hint style="danger" %}
Caution: Always keep backup of your existing WooCommerce installation including Mysql Database, before installing a new module.
{% endhint %}

### Method 1: Install via WordPress plugin Installer

1. Log in to WordPress Admin panel
2. Go to Add a new plugin.
3. Click on the upload plugin.
4. Choose the downloaded zip "casheer.zip" ([Download Plugin](https://github.com/Casheer/casheer-checkout)) and click Install Now.

![](/files/zmzgHFAu5Y1LXBQuCcuD)

### Method 2: Install Plugins Manually through FTP

1\. Unzip and copy ‘**casheerpay**’ folder from downloaded **casheerpay.zip** file and upload to your`/wp-content/plugins` folder.

![](/files/gdF2aIwonsdHMPgK8Y6b)

### **Plugin Activation**

1. Login to WP admin.
2. Go to Plugin
3. Choose Casheer Pay and Activate Plugin.

![](/files/peWGBU175NsDOQQchGnA)

**Configure Keys:**

Step 1: Go to Plugin Setting

Step 2: Tick to enable the module and configure your keys & credentials.

![](/files/OJnrso0Q5Ct9mM3AqvJ4)

#### Add & Configure Payment Method:

Step 1: Select the “customize your payment form” option from the payment method dropdown.

<figure><img src="/files/7J6FJae3kOEGCHyBuMAo" alt=""><figcaption></figcaption></figure>

Step 2: Click on the “add new payment methods”.

<figure><img src="/files/Ub5dU6Pz2JF9gSpvUd4x" alt=""><figcaption></figcaption></figure>

Step 3: Add payment methods, Channel code and Currency code

{% hint style="warning" %}
Note: Log in to the portal and go to --> Configurations--> Payment Channels to obtain payment channel details.
{% endhint %}

<figure><img src="/files/zDpFDYZSVg8RFfpkgzGf" alt=""><figcaption></figcaption></figure>

#### Frontend Output:

Method 1: Using payment method as "Customize Your Payment Form"

<figure><img src="/files/69lFBBvM10XcFCzt1zjN" alt=""><figcaption></figcaption></figure>

Method 2: Using payment method as "Casheer Payment Form"

<figure><img src="/files/1xYFyfs7MICFWaUvjz9L" alt=""><figcaption></figcaption></figure>

### Support

If you have any questions that are beyond the scope of this help file, please feel free email us at <info@casheer.com>


# Drupal Commerce

Integrating your Drupal Commerce store with Casheer Pay services allows you to accept payments on your Drupal Commerce store with simple installation. You can accept payments via Debit & Credit Card, & ATM Cards. The plugin offers seamless integration, allowing the customer to pay on your website with a high secure PCI compliance hosted environment and work across all browsers and ensures compatibility with the below versions of Drupal.

### **Compatibilities and Dependencies** <a href="#compatibilities-and-dependencies" id="compatibilities-and-dependencies"></a>

* Drupal 8.9.x (or) higher
* Drupal Commerce v2.19 (or) higher

{% hint style="warning" %}
**Note:** Drupal 7 module works on only v7.5 to v.7.72 of Drupal 7.
{% endhint %}

### Installation

There are two methods to install the Casheer Pay Payment Module

1. [Install via Drupal module installer](/modules-setup-guides/drupal#1-installation-via-drupal-module-installer)
2. [Install via manually through FTP](/modules-setup-guides/drupal#2-installation-via-manually-through-ftp-and-follow-the-process-from-above-step-2)

{% hint style="danger" %}
**Caution:** Always keep backup of your website including databases, before installing a new module.
{% endhint %}

### 1. Installation via Drupal module installer

**Step 1**: Go to Modules Section from Administration&#x20;

1.1 Click on "Install new module"

![](/files/-MF_Px8WaOBnDWAmHsm5)

1.2 Upload Casheer Pay Module from the downloaded zip file.

![](/files/-MHMYyo5WYYLUMPdqw44)

**Step 2:** Go to **Site settings >> Modules** and switch on "**Commerce casheerpay**&#x20;

![](/files/-MHM_oq6v4nRQ45blvZN)

**Step 2:** Go to **Store settings >> Payment methods >>** Enable Casheer Pay Module

![](/files/-MHMZeguvkP4UH90n4q5)

**Step 4:** Edit Casheer Pay Module

![](/files/-MHMcxcCd_RyIEsyvRYy)

**Step 5:** Configure Your Keys & Credentials

![](/files/-MF_U6N_U0T1JA3_VyyN)

### 2. Installation via manually through FTP & Follow the process from above **Step 2**.

![](/files/-MF_d0czsdgKLmYPamBA)

### &#x20;Support

If you have any questions that are beyond the scope of this help doc, please feel free email us at <pay.support@oneglobal.com>


# OpenCart

Integrating your OpenCart store with Casheer Pay services allows you to accept payments on your OpenCart store with simple installation. You can accept payments via Debit & Credit Card, & ATM Cards. The plugin offers seamless integration, allowing the customer to pay on your website with a high secure PCI compliance hosted environment and work across all browsers. and ensures compatibility with the below versions of OpenCart.

### **Compatibilities and Dependencies**

* Opencart 3.0.2.0 (or) higher

{% hint style="warning" %}
**Note:** This module works on only 3x versions of OpenCart.
{% endhint %}

### Installation

{% hint style="danger" %}
**Caution:** Always keep backup of your website including databases, before installing a new module.
{% endhint %}

**Step 1:** Go to Extensions > Extension Installer in admin panel and upload Casheer Pay extension.

![](/files/-MF_B7NPUcV9qBqPdRkU)

Make sure it should be installed successfully without any errors.

![](/files/-MFaO2nz2jWN04CJBYau)

**Step 2:** Go to Extensions & Select Payment from the Extensions list, you will find the Casheer Pay in the payment modules and click on Edit button.

![](/files/-MFaRPt9XBmZlJqK5AlX)

**Step 3:** Enable Casheer Pay from the status option.

![](/files/-MFaRVU7IF8WSijSp7lk)

**Step 4:** Configure Your Keys & Credentials.

![](/files/-MFaR__E5t1azPKDHAqx)

{% hint style="danger" %}
Due to FTP permissions in OpenCart stores some versions may I.e., OpenCart v2.1x, v2.0x could not override the module files through the installer method in admin so please use manual installation via FTP upload in order to override files.
{% endhint %}

### Manual Installation method via FTP

![](/files/-MHFejJXKvya0jYvTEJZ)

### Support <a href="#support" id="support"></a>

If you have any questions that are beyond the scope of this help doc, please feel free email us at [pay.support@oneglobal.com](mailt:pay.support@oneglobal.com)


# Magento 1

Integrating your Magento1 store with Casheer Pay services allows you to accept payments on your Magento1 store with simple installation. You can accept payments via Debit & Credit Card, & ATM Cards. The plugin offers seamless integration, allowing the customer to pay on your website with a high secure PCI compliance hosted environment and work across all browsers and ensures compatibility with the below versions of Magento1.

### **Compatibilities and Dependencies**

* Compatibility with Open Source Community Edition: 1.9.x.

{% hint style="warning" %}
**Note:** This module works on only 1x versions of Magento.
{% endhint %}

### Installation Method 1

#### Installation through Admin Pane&#x6C;**:**&#x20;

{% hint style="danger" %}
**Caution:** Always keep backup of your website including databases, before installing a new module.
{% endhint %}

1. Login to Admin Panel. Go to "**System >> Manage connect >> Magento Connect Manager**".
2. Re-login using your Admin login details.

![](/files/-MHHm0So07e9mfD6maTI)

3\. Go to **"Direct Package file upload"** section, click on **"Browse Button"**, Select the package received to you, and finally click on **"Upload"** button.

![](/files/-MHHo9s9r0AlFi13dirT)

4\. Once package installed, click on **"Return to Admin"** link located on the top right second last link.

5\. Go to **System >> Cache Management**. Flush Magento Cache.

6\. Go to **System >> Configuration >> Sales >> Payment Method** enabled Casheer Pay and configure Your Keys & Credentials and add payment methods.

![](/files/-MHHq5ln63Tbekp4iZIG)

### Installation **Method 2**

#### Manual Installation via FTP.

1. Extract the module zip archive.&#x20;
2. Login to web server via FTP client and go to your magento directory.&#x20;
3. Upload extracted file in `magento_root`
4. **Go to Stores >> Configuration >> Sales >> Payment Methods** enabled Casheer Pay and Configure Your Keys & Credentials and add payment methods.

![](/files/-MHHs4LaZmWgc54xuedB)

### Support <a href="#support" id="support"></a>

If you have any questions that are beyond the scope of this help doc, please feel free email us at <pay.support@oneglobal.com>


# Magento 2

Integrating your Magento2 store with Casheer Pay services allows you to accept payments on your Magento2 store with simple installation. You can accept payments via Debit & Credit Card, & ATM Cards. The plugin offers seamless integration, allowing the customer to pay on your website with a high secure PCI compliance hosted environment and work across all browsers and ensures compatibility with the below versions of Magento2.

### **Compatibilities and Dependencies**

* Compatibility with Open Source Community Edition : 2.0.x, 2.1.x, 2.2.x, 2.3.x, 2.4.x.

{% hint style="warning" %}
**Note:** This module works on only 2x versions of Magento.
{% endhint %}

### Installation

{% hint style="danger" %}
**Caution:** Always keep backup of your website including databases, before installing a new module.
{% endhint %}

**Step 1:** Uploading files to the server

1. Extract the module zip archive.&#x20;
2. Login to web server via FTP client and go to your magento directory.&#x20;
3. Upload extracted file in `magento_root/app/code`

{% hint style="warning" %}
Note: If you have already a code folder in your magento directory you can skip the above point 3.
{% endhint %}

![](/files/-MGhLlkSrXNMWiNJN_Q-)

**Step 2:** Enable extension

1. Login to the server via ssh client&#x20;
2. Go to magento root directory
3. Run the following commands:&#x20;

{% tabs %}
{% tab title="Commands" %}

```
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy (If it does not work please try "php bin/magento setup:static-content:deploy -f")  
php bin/magento cache:flush
```

{% endtab %}

{% tab title="Description" %}

```
To install the extension
To compile the code
To deploy static view files
To flush cache
```

{% endtab %}
{% endtabs %}

**Step 3:** Go to Stores >> Configuration >> Sales >> Payment Methods and enabled Casheer Pay

![](/files/-MGhaS7eIwzctRupldr1)

**Step 4:** Configure Your Keys & Credentials and add payment methods.

{% hint style="warning" %}
Please note: In some cases require to flush cache at the store backend by Navigate to the **Admin Panel**> **System**> **Cache Management**:
{% endhint %}

### Support <a href="#support" id="support"></a>

If you have any questions that are beyond the scope of this help doc, please feel free email us at <pay.support@oneglobal.com>


# PrestaShop

Integrating your PrestaShop store with Casheer Pay services allows you to accept payments on your PrestaShop store with simple installation. You can accept payments via Debit & Credit Card, & ATM Cards. The plugin offers seamless integration, allowing the customer to pay on your website with a high secure PCI compliance hosted environment and work across all browsers. and ensures compatibility with the below versions of PrestaShop.

### **Compatibilities and Dependencies**

* PrestaShop 1.6.1x and 1.7.0.x

### Installation

{% hint style="danger" %}
**Caution:** Always keep backup of your website including databases, before installing a new module.
{% endhint %}

**Step 1:** Go to Modules and Services > Add a new module

![](/files/-MJNe_mTGx4NkPsfSV-x)

**Step 2:** Upload Casheer Pay module

![](/files/-MJNevwe5fmyLYVf3y8z)

**Step 3:** Install Casheer Pay Module

![](/files/-MJNfKx_KxohPCmfwIYs)

**Step 4**: Configure Your Keys & Credentials and add payment methods.

![](/files/-MJNg1qy_FW6iMszGBqb)

![](/files/-MJQihLnf5rOpamxr-Xr)

### Support <a href="#support" id="support"></a>

If you have any questions that are beyond the scope of this help doc, please feel free email us at <pay.support@oneglobal.com>


# Joomla

Integrating your Joomla VirtueMart store with Casheer Pay services allows you to accept payments on your Joomla VirtueMart store with simple installation. You can accept payments via Debit & Credit Card, & ATM Cards. The plugin offers seamless integration, allowing the customer to pay on your website with a high secure PCI compliance hosted environment and work across all browsers and ensures compatibility with the below versions of Joomla VirtueMart.

### **Compatibilities and Dependencies**

* Joomla v3x with VirtueMart v3x

### Installation

{% hint style="danger" %}
**Caution:** Always keep backup of your website including databases, before installing a new module.
{% endhint %}

**Step 1**

1. Login to Joomla admin
2. Go to **Extension -> Manage -> Install**
3. Select **Upload Package File** section tab.
4. Upload Casheer Pay plugin zip file
5. Make sure the plugin installed successfully without any errors.

![](/files/-MLCRgr6w7aXIoV0e8yg)

![](/files/-MLCT8m-oTQCK4cWcXsV)

**Step 2**

1. Go to **VirtueMart -> Payment Methods**
2. Create a **New** Payment Method
3. Fille **Payment Method** input fields and make sure it selected **Casheerpay** in Payment Method & Save as shown in below the second screenshot.

![](/files/-MLCTyV30kBHjnDCMlKg)

![](/files/-MLCV515NXbdqqBi76Ko)

**Step 3**

1. Go to **Configuration** tab section and fill your Keys & Credentials.

![](/files/-MLCX6BnzTfGC5XFQivO)

### Support <a href="#support" id="support"></a>

If you have any questions that are beyond the scope of this help doc, please feel free email us at <pay.support@oneglobal.com>


# WHMCS

Integrating your WHMCS store with Casheer Pay services allows you to accept payments on your WHMCS store with simple installation. You can accept payments via Debit & Credit Card, & ATM Cards. The plugin offers seamless integration, allowing the customer to pay on your website with a high secure PCI compliance hosted environment and work across all browsers. and ensures compatibility with the below versions of WHMCS.

### **Compatibilities and Dependencies**

* WHMCS 7x

### Installation

{% hint style="danger" %}
**Caution:** Always keep backup of your website including databases, before installing a new module.
{% endhint %}

**Step 1:**&#x20;

1. Extract the module zip archive.&#x20;
2. Login to web server via FTP client and go to your WHMCS directory.&#x20;
3. Upload extracted file

![](/files/-MKd5wm6VYtMkSqrgRxd)

**Step 2**&#x20;

1. Login to WHMCS admin
2. Go to **Setup -> Payments -> Payment Gateways -> All Payment gateways** and&#x20;
3. Activate Casheer Pay and Configure your Keys & Credentials.

![](/files/-MKdBGS-GrOuRw7euRm6)

![](/files/-MKdCM330YhUZrDBrJkA)

**Step 3:**&#x20;

1. Go to **Setup -> Addon Modules -> Casheer Pay ->** Click on Activate and Configure to assign the permission of addon to user.

![](/files/-MKd8QxGc04L4SFFXW3v)

![](/files/-MKd9_z8_-XWZgLVhZnr)

**Step 4:**

1. Go to **Setup -> Addon Modules -> Casheer Pay ->** Configure Your Payment Methods.

### Support <a href="#support" id="support"></a>

If you have any questions that are beyond the scope of this help doc, please feel free email us at <pay.support@oneglobal.com>


