PHPackages                             tajulsharby/senangpay - 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. tajulsharby/senangpay

ActiveLibrary[Payment Processing](/categories/payments)

tajulsharby/senangpay
=====================

This package will provide facade and easy integration with SenangPay payment gateway.

394[1 issues](https://github.com/tajulsharby/laravel-senangpay/issues)[1 PRs](https://github.com/tajulsharby/laravel-senangpay/pulls)PHP

Since Dec 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/tajulsharby/laravel-senangpay)[ Packagist](https://packagist.org/packages/tajulsharby/senangpay)[ RSS](/packages/tajulsharby-senangpay/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Senang Pay
==========

[](#senang-pay)

[![Build Status](https://camo.githubusercontent.com/4cffa387121c94f03ab7a3af7c90b956f46b4f6c072147903d9b5fe9a51f4954/68747470733a2f2f7472617669732d63692e6f72672f6a6f6d6f732f73656e616e672d7061792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jomos/senang-pay)[![styleci](https://camo.githubusercontent.com/4499ec3a0efa386c7581f730bb44592bf518dc156779fc92c663dd51908cfb92/68747470733a2f2f7374796c6563692e696f2f7265706f732f4348414e47454d452f736869656c64)](https://styleci.io/repos/CHANGEME)[![Packagist](https://camo.githubusercontent.com/ab862350fa27eebf470ede4b0defee7ca80812e8295b9b82e46f998c0fb81edc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f6d6f732f73656e616e672d7061792e737667)](https://packagist.org/packages/jomos/senang-pay)[![Packagist](https://camo.githubusercontent.com/e9fbdddcfbacbe68bc378dcb9fd5fc654b035b2dd24e2691b74ab7f0ebd23b6c/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6d6f732f73656e616e672d7061792f642f746f74616c2e737667)](https://packagist.org/packages/jomos/senang-pay)[![Packagist](https://camo.githubusercontent.com/1fb810d8a444367342613cfbc74e73e722945e1cb3ec79818179a58030f405ac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6f6d6f732f73656e616e672d7061792e737667)](https://packagist.org/packages/jomos/senang-pay)

Package description: This is a simple package to allow using Senangpay Payment Gateway API in Laravel Project

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

[](#installation)

Install via composer

```
composer require tajulsharby/senangpay

```

### Register Service Provider

[](#register-service-provider)

**Note! This and next step are optional if you use laravel&gt;=5.5 with package auto discovery feature.**

Add service provider to `config/app.php` in `providers` section

```
Jomos\SenangPay\ServiceProvider::class,
```

### Register Facade

[](#register-facade)

Register package facade in `config/app.php` in `aliases` section

```
Jomos\SenangPay\Facades\SenangPay::class,
```

### Publish Configuration File

[](#publish-configuration-file)

```
php artisan vendor:publish --provider="Jomos\SenangPay\ServiceProvider" --tag="config"

```

Usage
-----

[](#usage)

Step 1: Make sure you already register with Senangpay Step 2: Login and get your Merchant ID and your Secret Key Then please enter this inside field for Return Url: 'http://\[YOUR DOMAIN NAME\]/process-return-url' Then enter this in Return URL Parameters: '?status\_id=\[TXN\_STATUS\]&amp;order\_id=\[ORDER\_ID\]&amp;transaction\_id=\[TXN\_REF\]&amp;message=\[MSG\]&amp;hash=\[HASH\]'

Step 3: (assuming you already install this package and publish them) Go to config/senangpay.php and edit your Merchant Id and your Secret Key accordingly (which you get from step 2).

Step 4: In Your controller add this to your ordering processing method.

Example: After customer click checkout or pay, the form should submit via post to a controller method

```
use Jomos/SenangPay/Senangpay;

class PaymentController extends Controller {

    public function processOrder(Request $request){

        // .. prior code usually on taking orders and save to orders table

        $payerName = $request->payer_name;
        $payerEmail = $request->payer_email;
        $payerPhone = $rquest->payer_phone;
        $detail = 'Order For something something'; // Change to any title of this order
        $orderId = '1234567'; // Make sure it is a unique no and not a running number that payer can guest.
        $amount = '300'; // Equals to RM300.00

        Senangpay::setPaymentDetails( $payerName, $payerEmail, $payerPhone, $detail, $orderId, $amount );
        return Senangpay::processPayment();

    }

    public function processReturnUrl(Request $request){

        if(Senangpay::checkIfReturnHashCorrect( $request ) == true)
        {
		        $order = Order::find($request->order_id);

            if( $request->status_id == 1 )
            {
              $order->payment_status = 'Paid';
                    $order->senangpay_transaction_id = $request->transaction_id;
                    $order->confirm_payment_date = date('Y-m-d');
                    $order->save();
              return redirect()->to('success');

            } else {

              return redirect()->to('fail');

            }

        }

    }

}
```

Step 5: In routes/web.php add these 2 routes:

```
    Route::post('process-order', 'PaymentController@processOrder');
    Route::get('process-return-url', 'PaymentController@processReturnUrl');
```

Security
--------

[](#security)

If you discover any security related issues, please email instead of using the issue tracker.

Credits
-------

[](#credits)

- [](https://github.com/jomos/senang-pay)
- [All contributors](https://github.com/jomos/senang-pay/graphs/contributors)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/53b761555be908b611c9cc6cc906ace470ad8560e7770edb1235af58c7451a27?d=identicon)[tajulsharby](/maintainers/tajulsharby)

---

Top Contributors

[![tajulsharby](https://avatars.githubusercontent.com/u/373162?v=4)](https://github.com/tajulsharby "tajulsharby (3 commits)")

### Embed Badge

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

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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