PHPackages                             h2akim/senangpay-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. [Payment Processing](/categories/payments)
4. /
5. h2akim/senangpay-php

ActiveLibrary[Payment Processing](/categories/payments)

h2akim/senangpay-php
====================

SenangPay Payment Gateway PHP Library (unofficial)

v2.0.0(1mo ago)38401[1 issues](https://github.com/h2akim/senangpay-php/issues)MITPHPPHP ^8.2

Since May 17Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/h2akim/senangpay-php)[ Packagist](https://packagist.org/packages/h2akim/senangpay-php)[ RSS](/packages/h2akim-senangpay-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

PHP framework agnostic to work with senangPay API
=================================================

[](#php-framework-agnostic-to-work-with-senangpay-api)

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

[](#installation)

```
composer require php-http/guzzle7-adapter h2akim/senangpay-php
```

#### HTTP Adapter

[](#http-adapter)

Refer [PHP-HTTP Clients &amp; Adapters](http://docs.php-http.org/en/latest/clients.html) for other supported clients and adapters.

Get Started
-----------

[](#get-started)

### Creating client

[](#creating-client)

```
use SenangPay\Client;
use SenangPay\Config;
use Laravie\Codex\Discovery;

$http = Discovery::client();

// OpenApi — payment URL creation + callback verification
$openApi = Client::makeOpenApi($http, new Config(
    merchantId: 'your_merchant_id',
    secretKey: 'your_secret_key',
));

// ApiV1 — query order/transaction status
$apiV1 = Client::makeApiV1($http, new Config(
    merchantId: 'your_merchant_id',
    secretKey: 'your_secret_key',
));

// Direct — client session + FPX bank list (Basic Auth)
$direct = Client::makeDirect($http, new Config(
    merchantId: 'your_merchant_id',
    secretKey: 'your_secret_key',
));

// Refund — get token → create refund (Bearer token)
$refund = Client::makeRefund($http, new Config(
    merchantId: 'your_merchant_id',
    secretKey: 'your_secret_key',
));

// Payout — submit payout (Basic Auth + SHA256)
$payout = Client::makePayout($http, new Config(
    merchantId: 'your_merchant_id',
    secretKey: 'your_secret_key',
));

// Tokenisation — token pay/updateStatus/validate
$tokenisation = Client::makeTokenisation($http, new Config(
    merchantId: 'your_merchant_id',
    secretKey: 'your_secret_key',
));

// Recurring — create recurring product (Basic Auth)
$recurring = Client::makeRecurring($http, new Config(
    merchantId: 'your_merchant_id',
    secretKey: 'your_secret_key',
));
```

### Config

[](#config)

```
use SenangPay\Config;

// Default (production, hash md5)
$config = new Config(
    merchantId: 'xxx',
    secretKey: 'xxx',
);

// Sandbox + SHA256
$config = new Config(
    merchantId: 'xxx',
    secretKey: 'xxx',
    hashType: 'sha256',
    sandbox: true,
);

// Custom version
$config = new Config(
    merchantId: 'xxx',
    secretKey: 'xxx',
    version: 'v1',
);

// Custom base URI (overrides all defaults)
$config = new Config(
    merchantId: 'xxx',
    secretKey: 'xxx',
    baseUri: 'https://custom.example.com',
);
```

### Use Sandbox

[](#use-sandbox)

Set `sandbox: true` in Config to use sandbox endpoints. Domains with sandbox support:

DomainSandbox URLOpenApi`https://sandbox.senangpay.my`ApiV1`https://sandbox.senangpay.my/apiv1`Direct`https://api.sandbox.senangpay.my`Refund`https://api.sandbox.senangpay.my`Payout`https://api.sandbox.senangpay.my`Recurring`https://api.sandbox.senangpay.my/recurring`Tokenisation does not support sandbox.

Domains
-------

[](#domains)

DomainDescriptionResource[OpenApi](docs/openapi.md)Payment URL creation &amp; callback verification`$openApi->payment()`[ApiV1](docs/apiv1.md)Order/transaction status queries`$apiV1->order()`, `->transaction()`, `->transactions()`[Direct](docs/direct.md)Client session &amp; FPX bank list`$direct->payment()`, `->fpxBank()`[Refund](docs/refund.md)Token-based refunds`$refund->refund()`[Payout](docs/payout.md)Merchant payout submissions`$payout->payout()`[Tokenisation](docs/tokenisation.md)Token pay, status update, validation`$tokenisation->token()`[Recurring](docs/recurring.md)Recurring product creation`$recurring->product()`License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance84

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/175e0f9aeb3bc0c716a25d7a84be027bc76e2545b9daaebe43af888b6f0838e9?d=identicon)[hakimrazalan](/maintainers/hakimrazalan)

---

Top Contributors

[![h2akim](https://avatars.githubusercontent.com/u/514048?v=4)](https://github.com/h2akim "h2akim (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/h2akim-senangpay-php/health.svg)

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

PHPackages © 2026

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