PHPackages                             namigo-sdk/namigo-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. namigo-sdk/namigo-sdk-php

ActiveLibrary[API Development](/categories/api)

namigo-sdk/namigo-sdk-php
=========================

Namigo PHP Payment SDK

v0.1.2(4y ago)02MITPHPPHP &gt;=5.3.0

Since Feb 18Pushed 3y ago2 watchersCompare

[ Source](https://github.com/namipg/namigo-sdk-php)[ Packagist](https://packagist.org/packages/namigo-sdk/namigo-sdk-php)[ Docs](https://psp.digitalworld.com.sa/)[ RSS](/packages/namigo-sdk-namigo-sdk-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Nami-Go-php
===========

[](#nami-go-php)

### Prerequisites

[](#prerequisites)

- A minimum of PHP 5.3 is required

Installation
------------

[](#installation)

- If your project using composer, run the below command

```
composer require psp-sdk/psp-sdk-php

```

- If you are not using composer, download the latest release from [the releases section](https://github.com/namipg/namigo-sdk-php). **You should download the `psp-sdk-php-master.zip` file**. After that, include `Namipay.php` in your application and you can use the API as usual.

\##Note: This PHP library follows the following practices:

- Namespaced under `Namipay\Api`
- API throws exceptions instead of returning errors
- Options are passed as an array instead of multiple arguments wherever possible
- All requests and responses are communicated over JSON

Basic Usage
-----------

[](#basic-usage)

Instantiate the namipay php instance with `user_name ` , `password` &amp; secret\_key(These will be different for Test and Live). You can obtain the keys from the dashboard app ()

```
use Namipay\Api\Api;

$secret_key = 'dCtLbk5FYVFGMVYrbFNGZTdEdzVpbSt3TFlYOC9NczNLaDZ0ZFo1WHcwVT0=';
$api_user_name = 'psp_test.eaohcfml.ZWFvaGNmbWw=';
$api_password = 'L1VPcklHbnh6T3RyWkdEVWZhci9HR1hSaHlrb0MwVEN5R0VtcUxkWHMwWT0=';
$apiMode = 0; // 0=Test, 1=Live
$api = new Api($api_user_name, $api_password, $apiMode);
```

The resources can be accessed via the `$api` object. All the methods invocations follows the following pattern

```
    //$api->class->function() to access the API
    //Example
    //This is for encrypt decrypt before call API
    //Create Payment
    $paymentParm = array('customer' =>array('name'=>'Raj', 'email'=>'raj2022@example.com') ,'order'=>array('amount'=>'1', 'currency' => 'SAR'),'sourceOfFunds' => array('provided'=>array('card'=>array('number'=>'5123450000000008','expiry'=>array('month'=>'12','year'=>'2023'), 'cvv'=>'999')), 'cardType' => 'C'), 'remark'=>array('description'=>'This payment is done by card'));
    $api->encryptDecrypt->create($paymentParm, $secret_key, 'encrypt');
    // Payment API
    //Alwase send $param['trandata'] in encrypted string
    $param['trandata'] = $encripted_result['content']['apiResponse'];
    $result = $api->payment->createPayment($param);

     //STC Pay Create Payment
    $stcParm = array('Customer' =>array('Name'=>'Dharmraj Kumhar', 'Email'=>'developers.wdp@gmail.com'),'DirectPaymentAuthorizeV4RequestMessage' =>array('MobileNo'=>'966557877988','Amount'=>'11','MerchantNote'=>'STC Payment'));
    $encripted_result = $api->encryptDecrypt->create($stcParm, $secret_key, 'encrypt');
    // Payment API
    //Alwase send $param['trandata'] in encrypted string
    $param['trandata'] = $encripted_result['content']['apiResponse'];
    $result = $api->payment->stcPay($param);

    //Refund Transaction
    $refundParm = array('transaction' =>array('id'=>'nt8my581z620365207292e','amount'=>'1', 'currency' => 'SAR'), 'remark'=>array('description'=>'Refund transaction'));
    $encripted_result = $api->encryptDecrypt->create($refundParm, $secret_key, 'encrypt');
    $param['trandata'] = $encripted_result['content']['apiResponse'];
    $result = $api->payment->refund($param);

    //Retrive Transaction
    $result = $api->payment->retriveTransaction($transactionId);

    //Transaction List between two date range
    $AllTransParm = array('transaction' =>array('startdate'=>'2022-01-15','enddate'=>'2022-02-09'));
    $result = $api->payment->transactionList($AllTransParm);

    //subscription
    $parms = array('customer' =>array('name'=>'Raj','email'=>'raj2022@example.com', 'interval'=>'1','interval_type'=>'3','interval_count'=>''),'order'=>array('amount'=>'1','currency' => 'SAR'),'sourceOfFunds' => array('provided'=>array('card'=>array('number'=>'5123450000000008','expiry'=>array('month'=>'12','year'=>'2023'), 'cvv'=>'999')),'cardType' => 'C'));
    $encripted_result = $api->encryptDecrypt->create($parms, $secret_key, 'encrypt');
    $param['trandata'] = $encripted_result['content']['apiResponse'];
    if(!empty($encripted_result['content']['apiResponse']) && $encripted_result['code'] == 200){
        $result = $api->payment->subscription($param);
    }

    //subscription detail
    $customer_id = "202130020209387";
    $result = $api->payment->subscriptionDetail($customer_id);

    //subscription cancel
    $customer_id = "202130294267467";
    $result = $api->payment->cancelSubscription($customer_id);
```

License
-------

[](#license)

The Namigo PHP SDK is released under the MIT License. See [LICENSE](LICENSE) file for more details.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

3

Last Release

1537d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bcf79ade3a4667bc0b0771987c99af019b790889ba19fcf14d4b7174eb7d2861?d=identicon)[namigo](/maintainers/namigo)

---

Top Contributors

[![aniljmk](https://avatars.githubusercontent.com/u/164242?v=4)](https://github.com/aniljmk "aniljmk (15 commits)")[![namipg](https://avatars.githubusercontent.com/u/117708127?v=4)](https://github.com/namipg "namipg (2 commits)")

---

Tags

phpapiclientomnipay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/namigo-sdk-namigo-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/namigo-sdk-namigo-sdk-php/health.svg)](https://phpackages.com/packages/namigo-sdk-namigo-sdk-php)
```

###  Alternatives

[razorpay/razorpay

Razorpay PHP Client Library

2024.8M44](/packages/razorpay-razorpay)[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

3633.0M18](/packages/kunalvarma05-dropbox-php-sdk)[culqi/culqi-php

Cliente Culqi API para PHP

41356.8k1](/packages/culqi-culqi-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
