# Introduction

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

Platform Payments 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 Platform Payments? 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,  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 Platform Payments 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 Og 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.  Og Checkout platform will get updated by  Payment  gateway provider.

### **Step 3:** Platform Payments Redirect Back to Merchant

Soon after amount Captured/Not Captured status received from payment gateway provider, Og 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.

Platform Payments 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 checkout flow.

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

### **1. Standard Checkout Method**

A standard checkout method is an out-of-the-box payment page where customers are redirected when they are ready to checkout. 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.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MSNk90BdaAVF9ABAGYm%2F-MSNkM79Sr06FXCIAX3w%2Fpayment-flow.png?alt=media\&token=20b0221e-6cf2-42d1-825f-241b0c56f821)

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 Platform Payments 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

{% hint style="info" %}
Please check out this page to download above Plugins/Apps/SDKs&#x20;
{% endhint %}

{% hint style="info" %}
For any integration related queries, you can get in touch with us&#x20;
{% endhint %}


# 1. Standard Checkout

A standard checkout method is an out-of-the-box payment page where customers are redirected when they are ready to checkout. 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.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MSNk90BdaAVF9ABAGYm%2F-MSNkM79Sr06FXCIAX3w%2Fpayment-flow.png?alt=media\&token=20b0221e-6cf2-42d1-825f-241b0c56f821)

####

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 Platform Payments 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


# Page


# 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
Production Base URL
```

{% endtab %}

{% tab title="Sandbox" %}

```
Sandbox Base URL
```

{% endtab %}
{% endtabs %}

### API Endpoints

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

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

{% endtab %}

{% tab title="Sandbox Endpoint" %}

<pre><code><strong>Sandbox Base URL /api/GenToken/Validate
</strong></code></pre>

{% 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 %}

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

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

<pre class="language-csharp"><code class="lang-csharp"><strong>public async Task> ValidatePayment(ValidatePaymentRequest obj)
</strong>  {
  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;
  }
</code></pre>

{% 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" %}

```php
<?php
// store order id
$order = 12 xxxx;
// referenceID must be 15 digit unique number
$referenceID = 123456412250000;
$timestamp = date( "y/m/d H:m:s t" );
// referenceID must be 10 digit unique number
$userReference = 1234564122;
$amount = 20.50;
$authKey = 'Your Authorization Key';
$merchantID = 'Your Merchent Key';
$currency = 'KWD';
// it should be ALL for all payment methods or specific payment method code i.e KNET
$paymentMethodCode = 'KNET';
// it will be null if store currency is same as your merchant currency.
$sourceCurrency = "";
// It will be Y if source currency and merchant currency is different
$doConvert = 'N';
// Concat all data string 
$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, $secretkey ) );
$data = array(
  'merchantCode' => $merchantID,
  'authKey' => $authKey,
  'currency' => $paymentMethodCurrency,
  'pc' => $paymentMethodCode,
  'tunnel' => $tunnel,
  'amount' => ( float )$amount,
  'doConvert' => $doConvert,
  'sourceCurrency' => $sourceCurrency,
  'description' => $description,
  'referenceID' => ( int )$ref,
  '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 );
if ( !$endpoint ) {
  $curl = curl_init( 'https://ogcheckoutstage.oneglobal.com/OgPay/V1/api/GenToken/Validate' );
} 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" %}

```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 OG}
  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 OG}
  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 OG}
$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 OG}
  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 %}

###


# 5. Refund Request

API to request the refund for the paid transactions.

### API Endpoints

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

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

{% endtab %}

{% tab title="Sandbox" %}

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

{% endtab %}
{% endtabs %}

### **Sample Request & Response**

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

```coffeescript
{
    "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 an 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 |
| `errorMessage`       | 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 Endpoint

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

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

{% endtab %}

{% tab title="Sandbo" %}

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

{% endtab %}
{% endtabs %}

### **Sample Request & Response**

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

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

}
```

{% endtab %}

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

```json
{
  "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 NotCaptured" %}

```
{
  "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

| Parameters  | Datatype      | Description                                                |
| ----------- | ------------- | ---------------------------------------------------------- |
| referenceID | String        | 15 digit unique transaction number                         |
| amount      | decimal       | Amount of transaction                                      |
| tranDate    | Integer       | Date of the transaction(DDMMYY)                            |
| result      | string        | Shows the result of the transaction (CANCELED or CAPTURED) |
| isRefunded  | Bool(nulable) | True if refunded                                           |

### 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 Platform Payments</p><p><code>Ex: KW23281</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **`authKey`**        | `string`   | Yes         | <p>Provided by Platform Payments</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="/payment-methods">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 OG  if requires.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **`amount`**         | `double`   | Yes         | Your customer transaction amount. `Ex: 1.000`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **`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 OG, in order to use this service. </p><p><code>Ex: 12345678</code></p>                                                    |
| **`hash`**           | `string`   | Yes         | <p>Please refer <a href="/sample-code/4.-compute-hash">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>    |
| **Bahrain** | `BH`         | <p>Benefit Debit Card</p><p>VISA/MasterCard</p>          | <p>BHBENEFITDC</p><p>BHKFHMPGSCC</p>                | <p>BHD</p><p>BHD</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 / 25</p><p>Any Other value for "NOT CAPTUED"</p> | 1234              |
| **Benefit**                 | 4600410123456789                                         | 05/29                                                  | 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&#x20;
{% endhint %}


# Direct Pay


# 1. Generate Merchant Keys

For direct pay integration merchant should have RSA public key. this endpoint to be used to generate the RSA key.

API Endpoints

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

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

```

{% endtab %}

{% tab title="Sandbox Endpoint" %}

```
SandboxBase URL /api/GenToken/GenrateMerchentKey
```

{% 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" %}

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

{% endtab %}
{% endtabs %}

MerchantCode and Auth key will be provided by Og.

#### 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. Users must regenerate a new merchant key every 24 hours.

If the merchant uses an invalid RSA public key, subsequent calls will result in the following error.

{"ErrorMessage":"Unable to decrypt card data "}


# 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" %}

```
"ValidateRequest" : {
  "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",
  "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 %}

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

After validating the merchant request, This API is used to process payment requests securely by encrypting card data using AES and RSA encryption.

#### API Endpoints

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

```
Direct Pay Production Base URL /InitiatePay
```

{% endtab %}

{% tab title="Sandbox Endpoint" %}

```
Direct Pay Sandbox Base URL /InitiatePay    
```

{% endtab %}
{% endtabs %}

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

The request body should include the following fields:

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

```
 "Initiate pay request{
     "ReferenceId" : "xxxxxxxxx",//15-digit reference id received in the validate requet response
     "MerchantId": xxxxxx, //merchant code
     "ECardData" = "encryptedCard", //card data encrypted using AES Encryption 
     "ECardKey" = "encryptedKey", // Encrypt the 32 digit AES key using the public key
     "ACS_CallbackURL"= "call back url for 3DS"+ReferenceId   //optional
     }
     
 };
```

{% 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="161">Field Name</th><th width="100">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</td></tr><tr><td>ECardData</td><td>string</td><td>The encrypted 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 decimal number
}
```

### ACS\_CallbackURL

* If empty, the 3D Secure callback will be handled by the provider, and the user will be redirected to call back url provided in the 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&#x20;

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

The ProcessPayment request is used 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.

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

```
Direct pay Production Base URL /ProcessPayment
```

{% endtab %}

{% tab title="Sandbox Endpoint" %}

```
Direct Pay SandboxBase URL /ProcessPayment
```

{% endtab %}
{% endtabs %}

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

```
{
    "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
}
```

{% 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 Platform Payments 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 v3.9.2 (or) higher
* WooCommerce v3.0 (or) higher

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

### Installation

There are two methods to install the Platform Payments 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 "platformpayments.zip" (Download Plugin) and click Install Now.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCSOcXT8-V2N3VKT4_M%2Fuploads%2FZmKQDfCcRNkELXJVf7oL%2Fimage%20\(4\).jpg?alt=media\&token=85341016-580c-4b49-b069-4054bbd8d2ae)

### Method 2: Install Plugins Manually through FTP

1\. Unzip and copy ‘PlatformPayments’ folder from downloaded platformpayment&#x73;**.zip** file and upload to your`/wp-content/plugins` folder.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCSOcXT8-V2N3VKT4_M%2Fuploads%2FN1dq2DEXijyQ34uyfJDw%2Fimage%20\(6\).jpg?alt=media\&token=fc30229a-0579-4de1-8aa0-547318a5af11)

### **Plugin Activation**

1. Login to WP admin.
2. Go to Plugin
3. Choose Platform Payments and Activate Plugin.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCSOcXT8-V2N3VKT4_M%2Fuploads%2FNQ9aMbLpu0qV8mAETucw%2Fimage%20\(5\).jpg?alt=media\&token=6f1ad322-6dcd-475f-83fc-bddb51d3dcc4)

**Configure Keys:**

Step 1: Go to Plugin Setting

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCSOcXT8-V2N3VKT4_M%2Fuploads%2FPYgx4vsvqWdbpyrh9NyZ%2Fimage%20\(7\).jpg?alt=media\&token=c35b1e7e-35c9-4d88-9558-b4fb39d0c17d)

### Support

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


# Drupal Commerce

Integrating your Drupal Commerce store with Platform Payments 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 Platform Payments Payment Module

1. [Install via Drupal module installer](/plugins-setup-guide/drupal#1-installation-via-drupal-module-installer)
2. [Install via manually through FTP](/plugins-setup-guide/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"

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MF_PrkdL-bqMOatmwmF%2F-MF_Px8WaOBnDWAmHsm5%2FModules-Commerce-Ogpay.png?alt=media\&token=637234a0-33cb-4a5a-a192-5e2dff5ed6a1)

1.2 Upload Platform Payments Module from the downloaded zip file.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCSOcXT8-V2N3VKT4_M%2Fuploads%2FRwepi6a2fGu1ybWguzfS%2Fimage%20\(8\).jpg?alt=media\&token=9b6384b0-c4ec-4b66-b098-e72c1f3a6de4)

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCSOcXT8-V2N3VKT4_M%2Fuploads%2FauGMQGzTkr5S65pAkZbN%2Fimage%20\(9\).jpg?alt=media\&token=c14a272e-b4dc-49f4-80c6-2781bfd7c8e5)

**Step 2:** Go to **Store settings >> Payment methods >>** Enable **Platform Payments** Module

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCSOcXT8-V2N3VKT4_M%2Fuploads%2FwkRxL5BvCaxfeBCIQLcn%2Fimage%20\(10\).jpg?alt=media\&token=6fa60dce-04ab-4bb8-88b8-b078528658de)

**Step 4:** Edit Platform Payments Module

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MHMZi6HG3R95ADtP9-M%2F-MHMcxcCd_RyIEsyvRYy%2FEditing-reaction-rule-Og-Checkout-Commerce-Kickstart.png?alt=media\&token=3c7404ff-a658-4d37-b758-7e13f4c69fbb)

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MF_SULnn7zPOtcZQAyV%2F-MF_U6N_U0T1JA3_VyyN%2FModules-Commerce-Ogpay-configure.png?alt=media\&token=6b567523-52b7-47c4-bfb5-ae2d30b988f8)

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MF__HcjXeCKq9oW9x9I%2F-MF_d0czsdgKLmYPamBA%2FModules-Commerce-Ogpay-ftp.png?alt=media\&token=50e0d11f-bd12-4450-90bb-06d0d6680668)

### &#x20;Support

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


# OpenCart

Integrating your OpenCart store with Platform Payments 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 Platform Payments extension.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MF_9jhDyfoTApODNMNo%2F-MF_B7NPUcV9qBqPdRkU%2FExtension-Installer.png?alt=media\&token=c07a9111-dafa-4f10-9ac0-132f89eda8b8)

Make sure it should be installed successfully without any errors.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MFaMroH1GOq_BdgmOPu%2F-MFaO2nz2jWN04CJBYau%2FExtension-Installer%202.png?alt=media\&token=1bb976cf-22a9-46bb-9517-1211ef123ad8)

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MFaMroH1GOq_BdgmOPu%2F-MFaRPt9XBmZlJqK5AlX%2FExtension-Installer%203.png?alt=media\&token=b7adf99a-5e5a-42f5-b19e-d977e35448e6)

**Step 3:** Enable Platform Payments from the status option.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MFaMroH1GOq_BdgmOPu%2F-MFaRVU7IF8WSijSp7lk%2FExtension-Installer%204.png?alt=media\&token=71c3986e-5c2f-4aa7-b17b-238a12882edd)

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MFaMroH1GOq_BdgmOPu%2F-MFaR__E5t1azPKDHAqx%2FExtension-Installer%205.png?alt=media\&token=66240b4b-088f-4958-a36d-0271fddc0ae4)

{% 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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MHFdhPt0lhHo-P9eRy3%2F-MHFejJXKvya0jYvTEJZ%2Fftp.png?alt=media\&token=89841e9c-9999-4674-ba80-d77ce30e63e0)

### 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 <checkout.support@oneglobal.com>


# Magento 1

Integrating your Magento1 store with Platform Payments 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.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MHHkfkQd8wTgBRqG22m%2F-MHHm0So07e9mfD6maTI%2F1.png?alt=media\&token=e67e17ae-9ab1-4f26-8d95-3463f9097d55)

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MHHkfkQd8wTgBRqG22m%2F-MHHo9s9r0AlFi13dirT%2F2.png?alt=media\&token=fab6571b-3598-4a13-b897-2f689b69791c)

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 Platform Payments and configure Your Keys & Credentials and add payment methods.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MHHo_uKyuimC38cLWNN%2F-MHHq5ln63Tbekp4iZIG%2F3.png?alt=media\&token=31422f56-3276-474a-8857-598020fe4448)

### 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 Platform Payments and Configure Your Keys & Credentials and add payment methods.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MHHr3uxgJgG1qTzoQ6L%2F-MHHs4LaZmWgc54xuedB%2F4.png?alt=media\&token=2e014469-5247-4ccc-a6e4-934aa665bad9)

### 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 <checkout.support@oneglobal.com>


# Magento 2

Integrating your Magento2 store with Platform Payments 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 %}

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MGhJKMewzctZz2PafUI%2F-MGhLlkSrXNMWiNJN_Q-%2F01.png?alt=media\&token=85c9b586-cbda-4200-9cca-7937cc811f70)

**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 Platform Payments

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MGhZzXcv-QxZHUe5Bel%2F-MGhaS7eIwzctRupldr1%2F02.png?alt=media\&token=5475cf38-399a-49d1-adc6-5e4af55d13aa)

**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 <checkout.support@oneglobal.com>


# PrestaShop

Integrating your PrestaShop store with Platform Payments 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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MJNe6fHsmtYG9veOFgX%2F-MJNe_mTGx4NkPsfSV-x%2F1.png?alt=media\&token=9272cbc8-4393-4f10-8773-52e4deff16f3)

**Step 2:** Upload Platform Payments module

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MJNenFLNAR2E-8H0hhH%2F-MJNevwe5fmyLYVf3y8z%2F2.png?alt=media\&token=3f33eea7-684d-4d10-b82a-dc937a376406)

**Step 3:** Install Platform Payments Module

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MJNf6sPsMP5_i3up3mp%2F-MJNfKx_KxohPCmfwIYs%2F3.png?alt=media\&token=2e95d2ed-ef77-465d-8bf4-f1bb5d7d7f97)

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MJNf6sPsMP5_i3up3mp%2F-MJNg1qy_FW6iMszGBqb%2F5.png?alt=media\&token=9c978548-dc9e-4bb0-a77e-c013b46b639e)

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MJQib8jExWkTFn63LWB%2F-MJQihLnf5rOpamxr-Xr%2F6.png?alt=media\&token=0c14db51-a5d6-4b39-b905-9d1732990a47)

### 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 <checkout.support@oneglobal.com>


# Joomla

Integrating your Joomla VirtueMart store with Platform Payments 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 Platform Payments plugin zip file
5. Make sure the plugin installed successfully without any errors.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MLCOjOiieOdxCAAYZGa%2F-MLCRgr6w7aXIoV0e8yg%2F01.png?alt=media\&token=8faf3092-43a5-40ed-b43f-640f4b302ccf)

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MLCOjOiieOdxCAAYZGa%2F-MLCT8m-oTQCK4cWcXsV%2F02.png?alt=media\&token=42105547-baa8-415f-96f4-20de36bbb1cb)

**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 **PlatformPayments** in Payment Method & Save as shown in below the second screenshot.

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MLCTEYdE-LCk6iOpZwL%2F-MLCTyV30kBHjnDCMlKg%2F03.png?alt=media\&token=612f8753-83d4-4b68-8bb4-533bd3d02146)

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MLCUm6L5LjS_vJ-YDZ5%2F-MLCV515NXbdqqBi76Ko%2F06.png?alt=media\&token=1ea5ce4a-383b-4027-9958-1df79e7ea06a)

**Step 3**

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MLCWy6Ivs2hR7ritbbd%2F-MLCX6BnzTfGC5XFQivO%2F07.png?alt=media\&token=7217e647-b28b-4b7f-9ddc-32eae4792f5b)

### 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 <checkout.support@oneglobal.com>


# WHMCS

Integrating your WHMCS store with Platform Payments 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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MKd5MvcuDQqX-jPnVZN%2F-MKd5wm6VYtMkSqrgRxd%2F1.png?alt=media\&token=d6b4b22c-b555-4ee3-b443-c055e2ecbece)

**Step 2**&#x20;

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MKdAP_rLcIJlYnvheRO%2F-MKdBGS-GrOuRw7euRm6%2F4.png?alt=media\&token=3dba033d-877f-4215-bcca-78c013c6a63c)

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MKdAP_rLcIJlYnvheRO%2F-MKdCM330YhUZrDBrJkA%2F5.png?alt=media\&token=ba1aae72-64fc-4f65-850d-92c3b9811d42)

**Step 3:**&#x20;

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

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MKd6FX6p54z1xibzVn7%2F-MKd8QxGc04L4SFFXW3v%2F2.png?alt=media\&token=a96c526b-bd4a-4854-99a9-b5ddc7668adb)

![](https://1754822595-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCSOcXT8-V2N3VKT4_M%2F-MKd8Vb7N0MpfL3xsU0Z%2F-MKd9_z8_-XWZgLVhZnr%2F3.png?alt=media\&token=14db1ee1-7fc2-4d35-87b9-6f8c53aa91a7)

**Step 4:**

1. Go to **Setup -> Addon Modules -> Platform Payments ->** 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 <checkout.support@oneglobal.com>


