PHPackages                             camoo/enkap-oauth - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. camoo/enkap-oauth

ActiveCamoo-plugin[Authentication &amp; Authorization](/categories/authentication)

camoo/enkap-oauth
=================

E-commerce Plugins for SmobilPay. OAuth Library

2.1.1(9mo ago)0186[1 PRs](https://github.com/camoo/enkap-oauth/pulls)GPL-2.0-or-laterPHPPHP &gt;=8.2CI failing

Since Sep 14Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/camoo/enkap-oauth)[ Packagist](https://packagist.org/packages/camoo/enkap-oauth)[ Docs](https://camoo.cm)[ RSS](/packages/camoo-enkap-oauth/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (10)Versions (17)Used By (0)

enkap-oauth Library
===================

[](#enkap-oauth-library)

SDK for e-nkap. SmobilPay e-commerce

> **Note**Only use this branch with PHP 8.2 and above

> **Note**Compatibility with PHP releases &lt; 8.2 are being maintained in the v1.0 branch

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

[](#installation)

```
composer require camoo/enkap-oauth
```

Usage
-----

[](#usage)

```
use Enkap\OAuth\Services\OAuthService;

$consumerKey = 'hqBvUfOjdLoP04763L_LDO';
$consumerSecret = 'FwxKTJzN4jE8IYdeCM83';

$service = new OAuthService($key, $secret);

var_dump($service->getAccessToken());
```

Initiate payment
----------------

[](#initiate-payment)

```
use Enkap\OAuth\Services\OAuthService;
use Enkap\OAuth\Model\Order;
use Enkap\OAuth\Services\OrderService;
use Enkap\OAuth\Lib\Helper;

$consumerKey = 'hqBvUfOjdLoP04763L_LDO';
$consumerSecret = 'FwxKTJzN4jE8IYdeCM83';

$orderService = new OrderService($key, $secret);
$order = $orderService->loadModel(Order::class);
$dataData = [
    'merchantReference' => uniqid('', true),
    'email' => 'enkap@mail.tld',
    'customerName' => 'My customer',
    'totalAmount' => 6400,
    'description' => 'Camoo Test Payment',
    'currency' => 'XAF',
    'items' => [
        [
            'itemId' => '1',
            'particulars' => 'soya bien pimenté',
            'unitCost' => 100,
            'quantity' => 50,
            'subTotal' => 5000
        ],
        [
            'itemId' => 2,
            'unitCost' => 700,
            'quantity' => 2,
            'particulars' => 'Bière 33 Export',
            'subTotal' => 1400,
        ]
    ]
];

try {
    $order->fromStringArray($dataData);
    $response = $orderService->place($order);
     // Save references into your Database
     $entity = $this->Payments->newEntity($dataData);
     $entity->set('oder_transaction_id', $response->getOrderTransactionId());
     $this->Payments->save($entity);

     // redirect User to Enkap System
     Helper::redirect($response->getRedirectUrl());

} catch (\Throwable $e) {
    var_dump($e->getMessage());
}
```

Get Payment Details
-------------------

[](#get-payment-details)

```
use Enkap\OAuth\Services\PaymentService;
use Enkap\OAuth\Model\Payment;

$consumerKey = 'hqBvUfOjdLoP04763L_LDO';
$consumerSecret = 'FwxKTJzN4jE8IYdeCM83';

$trxId = 'e07355446e0140ea9876a6ba38b155f3';
$paymentService = new PaymentService($key, $secret);
$payment = $paymentService->getByTransactionId($trxId);
// status
var_dump($payment->getPaymentStatus());
// order
var_dump($payment->getOrder());
# OR
$internalTrxId = '61405dc1a38878.58742206';
$paymentService = new PaymentService($key, $secret);
$payment = $paymentService->getByOrderMerchantId($internalTrxId);

// status
var_dump($payment->getPaymentStatus());
// order
var_dump($payment->getOrder());
```

Check Payment Status
--------------------

[](#check-payment-status)

```
use Enkap\OAuth\Services\StatusService;
use Enkap\OAuth\Lib\Helper;
use Enkap\OAuth\Model\Status;

$consumerKey = 'hqBvUfOjdLoP04763L_LDO';
$consumerSecret = 'FwxKTJzN4jE8IYdeCM83';

$trxId = 'e07355446e0140ea9876a6ba38b155f3';
$statusService = new StatusService($key, $secret);
$status = $statusService->getByTransactionId($trxId);
// Update your database
$query = $this->Payments->query()->set(['status' => $status->getCurrent()])->where(['oder_transaction_id' => $trxId]);
if ($status->confirmed()){
    // Payment successfully completed
    // send Item to user/customer
    return;
}

if ($status->failed() || $status->canceled()) {
  // delete that reference from your Database
}
```

Set Callback Urls to receive Payment status automatically
---------------------------------------------------------

[](#set-callback-urls-to-receive-payment-status-automatically)

```
use Enkap\OAuth\Services\CallbackUrlService;
use Enkap\OAuth\Model\CallbackUrl;

$setup = new CallbackUrlService($key, $secret);
$callBack = $setup->loadModel(CallbackUrl::class);
# The URL where to redirect the user after the payment is completed. It will contain the reference id generated by your system which was provided in the initial order placement request. E-nkap will append your reference id in the path of the URL with the form: http://localhost/action/return/{yourReferenceId}
$callBack->return_url = 'http://localhost/action/return';

# The URL used by E-nkap to instantly notify you about the status of the payment. E-nkap would append your reference Id (generated by your system and provided in the initial order placement request) as path variable and send a PUT with the status of the payment in the body as {"status":"[txStatus]"}, where [txStatus] the payment status.
$callBack->notification_url = 'http://localhost/action/notify'; // this action should accept PUT Request
$result = $setup->set($callBack);
if ($result === true) {
  // Callback URLs have been set
  //...
} else {
  // Failed to set Callback URLs
  //...
}
```

Delete Order
------------

[](#delete-order)

```
use Enkap\OAuth\Services\OrderService;
use Enkap\OAuth\Model\Order;

$consumerKey = 'hqBvUfOjdLoP04763L_LDO';
$consumerSecret = 'FwxKTJzN4jE8IYdeCM83';

$trxId = 'e07355446e0140ea9876a6ba38b155f3';
$orderService = new OrderService($key, $secret);
$orderModel = $orderService->loadModel(Order::class);
$orderModel->order_transaction_id = $trxId;
$result = $orderService->delete($orderModel);
if ($result === true) {
  // order has been deleted
  //...
}
```

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance68

Regular maintenance activity

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~151 days

Recently: every ~250 days

Total

11

Last Release

284d ago

Major Versions

1.0.7 → 2.0.02023-07-21

PHP version history (4 changes)1.0PHP &gt;=7.3

1.0.6PHP &gt;=7.4

2.0.0PHP &gt;=8.1

2.1.0PHP &gt;=8.2

### Community

Maintainers

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

---

Top Contributors

[![camoo](https://avatars.githubusercontent.com/u/24289021?v=4)](https://github.com/camoo "camoo (13 commits)")

---

Tags

CAMOOMobile money Gateway CameroonPlugin camoo PayenkapMTN Cameroon Mobile MoneyORANGE Cameroon Mobile MoneyExpress Union Cameroon Mobile MoneySmobil Cash pay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/camoo-enkap-oauth/health.svg)

```
[![Health](https://phpackages.com/badges/camoo-enkap-oauth/health.svg)](https://phpackages.com/packages/camoo-enkap-oauth)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)[descope/descope-php

Descope SDK for PHP

4426.8k](/packages/descope-descope-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)[lion/bundle

Lion-framework configuration and initialization package

132.4k5](/packages/lion-bundle)

PHPackages © 2026

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