Download the PHP package jiannius/senangpay without Composer
On this page you can find all versions of the php package jiannius/senangpay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package senangpay
Jiannius SenangPay
A Laravel SDK wrapper for SenangPay, the Malaysian payment gateway. It signs the outbound hash, validates inbound callbacks (regular and recurring), and wires the redirect / callback / webhook routes so you only have to write the controller actions.
Requirements
- PHP 8.3+
- Laravel 13
Installation
The service provider is auto-discovered. Nothing to publish.
Configuration
Add a senangpay entry to config/services.php:
In the SenangPay dashboard (Menu → Settings → Profile → Shopping Cart Integration Link), set Hash Type to SHA256. MD5 is not supported by this package and will silently mismatch every signature.
Routes & the host controller
The service provider registers three routes under the /__senangpay prefix and dispatches them to App\Http\Controllers\SenangpayController in your app. You must create that controller.
| Method | Path | Action | Purpose |
|---|---|---|---|
| GET | /__senangpay/redirect |
redirect |
Return URL — browser lands here after payment |
| GET | /__senangpay/recurring |
recurring |
Recurring-payment callback (new/remove/terminate) |
| POST | /__senangpay/webhook |
webhook |
Server-to-server callback |
Routes are registered with ->withoutMiddleware('web') so the webhook is not blocked by CSRF.
Usage
Redirect to checkout
checkout() returns a Laravel RedirectResponse to SenangPay's hosted payment page. Return it directly from your controller.
amount is normalised to a two-decimal string ("49.90") before hashing — pass it as a plain number, not a pre-formatted string.
Query an order's status (server-to-server)
Returns the first record from SenangPay's query_order_status response.
Normalised payment status
When called inside the redirect or webhook action, getStatus() collapses SenangPay's mixed numeric/string status values into one of success, failed, pending, or null.
Per-tenant credentials at runtime
Setters override the config('services.senangpay.*') defaults for the current request.
Test the connection
Hits query_order_status with a dummy order id — useful for a settings-page "Test credentials" button.
Host-app contracts
These aren't enforced by the package. Get them wrong and integrations silently break.
- The
webhookaction must respond with the literal stringOK. No HTML tags, no JSON, no redirect. If SenangPay doesn't seeOKin the response body, the callback is treated as failed and the merchant gets an email. - The
webhookaction must be idempotent on(order_id, status_id). SenangPay retries on a schedule: first call ~5 minutes after the transaction starts (if pending), real-time on any status change, and a final call ~1 hour after the transaction starts. A successful payment will hit your webhook multiple times. - The dashboard hash type must be SHA256. This package does not support MD5.
Reference
SenangPay developer documentation:
- Index
- Hash type & credentials
- Return URL parameters
- Callback URL
- Query order status
- Query transaction status
- Recurring callback
License
MIT — see LICENSE.md.
All versions of senangpay with dependencies
illuminate/support Version ^13.0
doctrine/dbal Version ^3.6|^4.0
symfony/http-client Version ^7.0|^8.0
laravel/pail Version ^1.0