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

ActiveLibrary[Payment Processing](/categories/payments)

eeric2eric/senangpay
====================

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

111PHPCI failing

Since Apr 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/eeric2eric/senangpay)[ Packagist](https://packagist.org/packages/eeric2eric/senangpay)[ RSS](/packages/eeric2eric-senangpay/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#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 eeric2eric/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

```
Eeric2eric\SenangPay\ServiceProvider::class,
```

### Register Facade

[](#register-facade)

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

```
Eeric2eric\SenangPay\Facades\SenangPay::class,
```

### Publish Configuration File

[](#publish-configuration-file)

```
php artisan vendor:publish --provider="Eeric2eric\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 Eeric2eric/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)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity34

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/87e05b346383d06f7f93a9c51ffef81454c242fd897884f1153f96751de8259a?d=identicon)[eric666](/maintainers/eric666)

---

Top Contributors

[![eeric2eric](https://avatars.githubusercontent.com/u/63334700?v=4)](https://github.com/eeric2eric "eeric2eric (7 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/eeric2eric-senangpay/health.svg)](https://phpackages.com/packages/eeric2eric-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)
