PHPackages                             nuocgansoi/laravel-onepay - 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. nuocgansoi/laravel-onepay

ActiveLibrary[Payment Processing](/categories/payments)

nuocgansoi/laravel-onepay
=========================

Provide a payment by Onepay

v3.6(8y ago)4601MITPHPPHP &gt;=7.0

Since Oct 31Pushed 8y ago1 watchersCompare

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

READMEChangelog (6)DependenciesVersions (15)Used By (0)

laravel-onepay
==============

[](#laravel-onepay)

publish this package and change config
--------------------------------------

[](#publish-this-package-and-change-config)

- php artisan migrate
- php artisan vendor:publish

Order status
------------

[](#order-status)

```
const STATUS_PENDING = 1;
const STATUS_PROCESSING = 2;
const STATUS_PAID = 3;
const STATUS_REJECTED = 4;
const STATUS_CANCELED = 5;
const STATUS_REFUNDED = 9;
```

Add to .env:
------------

[](#add-to-env)

```
ONEPAY_VERSION=2
ONEPAY_MERCHANT_ID=ONEPAY
ONEPAY_ACCESS_CODE=D67342C2
ONEPAY_SECURE_SECRET=A3EFDFABA8653DF2342E8DAC29B51AF0
ONEPAY_COMMAND=pay
ONEPAY_CURRENCY=VND
ONEPAY_LOCALE=vn
ONEPAY_TITLE="OnePay Gate"
ONEPAY_AMOUNT_EXCHANGE=100
ONEPAY_DO_URL=https://mtf.onepay.vn/onecomm-pay/vpc.op
ONEPAY_RETURN_URL=http://onepay.dev/onepay/result
ONEPAY_IPN_URL=http://onepay.dev/onepay/ipn

```

config/onepay.php:
------------------

[](#configonepayphp)

```
return [
    'version' => env('ONEPAY_VERSION', 2),
    'do_url' => env('ONEPAY_DO_URL', 'https://mtf.onepay.vn/onecomm-pay/vpc.op'),
    'return_url' => env('ONEPAY_RETURN_URL', 'http://localhost/return'),
    'ipn_url' => env('ONEPAY_IPN_URL', 'http://localhost/ipn'),
    'merchant_id' => env('ONEPAY_MERCHANT_ID', 'ONEPAY'),
    'access_code' => env('ONEPAY_ACCESS_CODE', 'D67342C2'),
    'secure_secret' => env('ONEPAY_SECURE_SECRET', 'A3EFDFABA8653DF2342E8DAC29B51AF0'),
    'command' => env('ONEPAY_COMMAND', 'pay'),
    'currency' => env('ONEPAY_CURRENCY', 'VND'),
    'locale' => env('ONEPAY_LOCALE', 'vn'),
    'title' => env('ONEPAY_TITLE', 'OnePay Gate'),
    'amount_exchange' => env('ONEPAY_AMOUNT_EXCHANGE', 100),
    'shop' => [
        'book' => [
            'model' => App\Book::class,
            'price' => 'price',
            'order' => [
                'model' => App\BookOrder::class,
                'customer_id' => 'user_id',
                'item_id' => 'book_id',
                'status' => [
                    'attribute' => 'status',
                    'pending' => App\BookOrder::STATUS_PENDING,
                    'processing' => App\BookOrder::STATUS_PROCESSING,
                    'paid' => App\BookOrder::STATUS_PAID,
                    'canceled' => App\BookOrder::STATUS_CANCELED,
                    'rejected' => App\BookOrder::STATUS_REJECTED,
                ],
            ],
        ],
    ],
];
```

Test card
---------

[](#test-card)

```
Thẻ VCB:
Tên: NGUYEN HONG NHUNG
Số thẻ: 6868682607535021
Tháng/Năm phát hành: 12/08
Mã OTP: 123456

```

Return in result view
---------------------

[](#return-in-result-view)

```
$view = $validator['success'] ? 'onepay::success' : 'onepay::failed';

return view($view, [
    'model' => $model,
    'message' => $validator['message'],
    'response' => $request->all(),
]);
```

Migrations
----------

[](#migrations)

```
Schema::create('onepay_payments', function (Blueprint $table) {
    $table->increments('id');
    $table->unsignedInteger('order_id')->nullable();
    $table->string('order_type')->nullable();
    $table->unsignedInteger('user_id')->nullable();
    $table->string('item_type')->nullable();
    $table->unsignedInteger('item_id')->nullable();
    $table->tinyInteger('status')->default(\NuocGanSoi\LaravelOnepay\Models\OnepayPayment::STATUS_PENDING);
    $table->string('access_code', 8);
    $table->string('currency', 3);
    $table->string('command', 16);
    $table->string('locale', 2);
    $table->string('merchant', 12);
    $table->string('return_url', 64);
    $table->string('version', 2);
    $table->string('amount', 21);
    $table->string('merch_txn_ref', 40)->index();
    $table->string('order_info', 40);
    $table->string('ticket_no', 16);
    $table->string('secure_hash', 64);
    $table->text('url')->nullable();
    $table->timestamps();
});
Schema::create('onepay_results', function (Blueprint $table) {
    $table->increments('id');
    $table->string('addition_data')->nullable();
    $table->string('amount', 21);
    $table->string('command', 16);
    $table->string('currency_code', 3);
    $table->string('locale', 2);
    $table->string('merch_txn_ref', 40)->index();
    $table->string('merchant', 12);
    $table->string('order_info', 40);
    $table->string('transaction_no', 12);
    $table->string('txn_response_code', 64);
    $table->string('version', 2)->nullable();
    $table->string('message', 200)->nullable();
    $table->string('secure_hash', 64);
    $table->text('response')->nullable();
    $table->timestamps();
});
Schema::create('onepay_ipns', function (Blueprint $table) {
    $table->increments('id');
    $table->string('addition_data')->nullable();
    $table->string('amount', 21);
    $table->string('command', 16);
    $table->string('currency_code', 3);
    $table->string('locale', 2);
    $table->string('merch_txn_ref', 40)->index();
    $table->string('merchant', 12);
    $table->string('order_info', 40);
    $table->string('transaction_no', 12);
    $table->string('txn_response_code', 64);
    $table->string('version', 2)->nullable();
    $table->string('message', 200)->nullable();
    $table->string('secure_hash', 64);
    $table->text('response')->nullable();
    $table->timestamps();
});
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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

13

Last Release

3152d ago

Major Versions

v1.0.0.x-dev → v2.02017-10-31

2.0.x-dev → v3.02017-11-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/f5af7e452aa2f160eb342b170811c3515e50bfcc0443f03ae916d9c10f088e45?d=identicon)[nuocgansoi](/maintainers/nuocgansoi)

---

Top Contributors

[![nuocgansoi](https://avatars.githubusercontent.com/u/21351524?v=4)](https://github.com/nuocgansoi "nuocgansoi (24 commits)")

---

Tags

laravelonepaynuocgansoi

### Embed Badge

![Health badge](/badges/nuocgansoi-laravel-onepay/health.svg)

```
[![Health](https://phpackages.com/badges/nuocgansoi-laravel-onepay/health.svg)](https://phpackages.com/packages/nuocgansoi-laravel-onepay)
```

###  Alternatives

[anandsiddharth/laravel-paytm-wallet

Integrate paytm wallet easily with this package. This package uses official Paytm PHP SDK's

102447.9k7](/packages/anandsiddharth-laravel-paytm-wallet)[threesquared/laravel-paymill

Laravel wrapper for the Paymill API

121.3k](/packages/threesquared-laravel-paymill)

PHPackages © 2026

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