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

ActiveLibrary[Payment Processing](/categories/payments)

faizulramir/senangpay
=====================

A Laravel package for integrating SenangPay payment gateway

v1.1.0(1y ago)010MITPHPPHP ^8.1

Since Apr 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/faizulramir/senangpay)[ Packagist](https://packagist.org/packages/faizulramir/senangpay)[ Docs](https://github.com/faizulramir/senangpay)[ RSS](/packages/faizulramir-senangpay/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Laravel SenangPay Package
=========================

[](#laravel-senangpay-package)

A Laravel package for integrating SenangPay payment gateway into your Laravel applications.

Features
--------

[](#features)

- Easy integration with SenangPay payment gateway
- Support for both sandbox and production environments
- Form-based payment submission
- Payment response handling
- Hash verification for secure transactions
- Configurable through environment variables

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Laravel &gt;= 10.0
- Composer

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

[](#installation)

1. Install the package via Composer:

```
composer require faizulramir/senangpay
```

2. Publish the configuration file:

```
php artisan vendor:publish --provider="Faizulramir\Senangpay\SenangpayServiceProvider"
```

3. Add the following environment variables to your `.env` file:

```
SENANGPAY_MERCHANT_ID=your_merchant_id
SENANGPAY_SECRET_KEY=your_secret_key
SENANGPAY_IS_SANDBOX=true

```

Configuration
-------------

[](#configuration)

The package configuration file (`config/senangpay.php`) contains the following options:

```
return [
    'merchant_id' => env('SENANGPAY_MERCHANT_ID'),
    'secret_key' => env('SENANGPAY_SECRET_KEY'),
    'is_sandbox' => env('SENANGPAY_IS_SANDBOX', true),
];
```

Usage
-----

[](#usage)

### Basic Payment Form

[](#basic-payment-form)

```
use Faizulramir\Senangpay\Senangpay;

class PaymentController extends Controller
{
    public function showPaymentForm()
    {
        $senangpay = new Senangpay();
        return view('payment.form', compact('senangpay'));
    }
}
```

In your Blade view:

```

    @csrf

    Pay Now

```

### Handling Payment Response

[](#handling-payment-response)

```
public function handlePaymentResponse(Request $request)
{
    $senangpay = new Senangpay();

    if ($senangpay->verifyHash($request->all())) {
        // Payment successful
        return view('payment.success');
    }

    // Payment failed
    return view('payment.failed');
}
```

Available Methods
-----------------

[](#available-methods)

### `getPaymentUrl()`

[](#getpaymenturl)

Returns the SenangPay payment URL based on the environment (sandbox/production).

### `generateHash(array $data)`

[](#generatehasharray-data)

Generates a hash for payment verification using the following parameters:

- detail
- amount
- order\_id

### `verifyHash(array $data)`

[](#verifyhasharray-data)

Verifies the payment response hash to ensure the transaction is legitimate.

Important Notes
---------------

[](#important-notes)

- Always validate payment responses using the `verifyHash()` method
- Keep your secret key secure and never expose it in client-side code
- Test thoroughly in sandbox mode before going live
- Make sure to handle both success and failure scenarios in your application

Security
--------

[](#security)

- The package uses SHA256 hashing for secure transaction verification
- All sensitive data is handled server-side
- Environment variables are used for configuration
- Hash verification is implemented to prevent tampering

Support
-------

[](#support)

If you encounter any issues or have questions, please open an issue in the GitHub repository.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance50

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Every ~0 days

Total

2

Last Release

389d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/300d1087d2308bda8d999c72d4d47b997e1b6e300cfda69c557fabc43905f257?d=identicon)[faizulramir](/maintainers/faizulramir)

---

Top Contributors

[![faizulramir](https://avatars.githubusercontent.com/u/98937618?v=4)](https://github.com/faizulramir "faizulramir (2 commits)")

---

Tags

laravelpaymentgatewayMalaysiaSenangPay

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

312.4k1](/packages/dena-a-iran-payment)[parsisolution/gateway

A Laravel package for connecting to all Iraninan payment gateways

231.7k](/packages/parsisolution-gateway)[sostheblack/moip

Laravel Package for Moip.

171.9k](/packages/sostheblack-moip)

PHPackages © 2026

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