PHPackages                             peterzero/laravel-omnipay - 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. peterzero/laravel-omnipay

ActiveLibrary[Payment Processing](/categories/payments)

peterzero/laravel-omnipay
=========================

Laravel Omnipay hổ trợ tích hợp các cổng thanh toán trong nước.

1.0.0(6y ago)06MITPHPPHP ^7.1

Since Jul 5Pushed 6y agoCompare

[ Source](https://github.com/peterzero/laravel-omnipay)[ Packagist](https://packagist.org/packages/peterzero/laravel-omnipay)[ Docs](https://github.com/phpviet/laravel-omnipay)[ RSS](/packages/peterzero-laravel-omnipay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (9)Versions (2)Used By (0)

 [ ![](https://avatars0.githubusercontent.com/u/958072) ](https://github.com/laravel)

Laravel Omnipay
===============

[](#laravel-omnipay)

 [![Latest version](https://camo.githubusercontent.com/95f6ddaecae14fbc6e14b0b0baab5ab80edccb35429511911378f1db46611515/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706870766965742f6c61726176656c2d6f6d6e697061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpviet/laravel-omnipay) [![Build status](https://camo.githubusercontent.com/bcba40b1cc299588e68eb87830131f289b2d777d49a8ea085efaa1c687b12c84/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f706870766965742f6c61726176656c2d6f6d6e697061792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/phpviet/laravel-omnipay) [![Quantity score](https://camo.githubusercontent.com/4d00f4e74a64b67855e501b5a1bc2d6f5d61b90f81d834df958acb8063da989c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f706870766965742f6c61726176656c2d6f6d6e697061792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/phpviet/laravel-omnipay) [![StyleCI](https://camo.githubusercontent.com/d13b267cf35f81df853aa2560ef15dc5c0fbd685b518a10c52eb8514739def07/68747470733a2f2f7374796c6563692e696f2f7265706f732f3138393035333933322f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/189053932) [![Total download](https://camo.githubusercontent.com/7ec991e4ac60b7942b828f4ddb7f98ba0ea9bed4d3cb2af1201cf57abe3dd26e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706870766965742f6c61726176656c2d6f6d6e697061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpviet/laravel-omnipay) [![License](https://camo.githubusercontent.com/6f7cbb65ec8807739a76e628dd5548998ac840b3d37ee19b2314a84d3b1f270c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706870766965742f6c61726176656c2d6f6d6e697061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpviet/laravel-omnipay)

Thông tin
---------

[](#thông-tin)

Hiện nay các cổng thanh toán trong nước có cấu trúc API rất đa dạng và ít có điểm chung, khiến cho việc chúng ta xây dựng các api-client cũng gặp nhiều khó khăn, chính vì vậy package này được sinh ra nhằm đồng bộ các phương thức của các cổng thanh toán, giúp cho việc tích hợp sẽ dễ dàng hơn, nó được thiết kế trên nền tảng [Omnipay](https://omnipay.thephpleague.com/)giúp bạn tối giản lại các tham trị khi tạo request gửi lên các cổng thanh toán. Do tất cả các cổng thanh toán đều có phương thức chung nên nó sẽ giúp cho bạn chuyển tiếp từ cổng thanh toán này sang cổng thanh toán khác đơn giản hơn.

Ví dụ:

```
\MoMoAIO::purchase([
    'amount' => 20000,
    'returnUrl' => 'https://github.com/phpviet',
    'notifyUrl' => 'https://github.com/phpviet',
    'orderId' => 'Mã đơn hàng',
    'requestId' => 'Mã request id, gợi ý nên xài uuid4',
])->send();

\OnePayDomestic::purchase([
    'AgainLink' => 'https://github.com/phpviet',
    'vpc_MerchTxnRef' => microtime(false),
    'vpc_ReturnURL' => 'https://github.com/phpviet',
    'vpc_TicketNo' => '127.0.0.1',
    'vpc_Amount' => '200000',
    'vpc_OrderInfo' => 456,
])->send();

\VNPay::purchase([
    'vnp_TxnRef' => time(),
    'vnp_OrderType' => 100000,
    'vnp_OrderInfo' => time(),
    'vnp_IpAddr' => '127.0.0.1',
    'vnp_Amount' => 1000000,
    'vnp_ReturnUrl' => 'https://github.com/phpviet',
])->send();

\VTCPay::purchase([
    'receiver_account' => '0963465816',
    'reference_number' => microtime(false),
    'amount' => 50000,
    'url_return' => 'https://phpviet.org'
])->send();
```

Các cổng thanh toán đang được hổ trợ tích hợp:

- **[MoMo](https://momo.vn)**
- **[OnePay](https://onepay.vn)**
- **[VNPay](https://vnpay.vn)**
- **[VTCPay](https://vtcpay.vn)**

Cài đặt
-------

[](#cài-đặt)

Cài đặt Laravel Omnipay thông qua [Composer](https://getcomposer.org):

```
composer require phpviet/laravel-omnipay
```

Sau khi cài đặt xong bạn cần phải publish config file để thiết lập thông số cho cổng thanh toán bạn cần tích hợp, publish thông qua câu lệnh:

```
php artisan vendor:publish --provider="PHPViet\Laravel\Omnipay\OmnipayServiceProvider" --tag="config"
```

Nội dung file publish nằm trong thư mục `config/laravel-omnipay.php` của bạn như sau:

```
return [
    // Cấu hình cho các cổng thanh toán tại hệ thống của bạn, các cổng không xài có thể xóa cho gọn hoặc không điền.
    // Các thông số trên có được khi bạn đăng ký tích hợp.

    'gateways' => [
        'MoMoAIO' => [
            'driver' => 'MoMo_AllInOne',
            'options' => [
                'accessKey' => '',
                'secretKey' => '',
                'partnerCode' => '',
                'testMode' => false,
            ],
        ],
        'MoMoQRCode' => [
            'driver' => 'MoMo_QRCode',
            'options' => [
                'accessKey' => '',
                'secretKey' => '',
                'partnerCode' => '',
                'testMode' => false,
            ],
        ],
        'MoMoAIA' => [
            'driver' => 'MoMo_AppInApp',
            'options' => [
                'accessKey' => '',
                'secretKey' => '',
                'partnerCode' => '',
                'publicKey' => '',
                'testMode' => false,
            ],
        ],
        'MoMoPOS' => [
            'driver' => 'MoMo_POS',
            'options' => [
                'accessKey' => '',
                'secretKey' => '',
                'partnerCode' => '',
                'publicKey' => '',
                'testMode' => false,
            ],
        ],
        'OnePayDomestic' => [
            'driver' => 'OnePay_Domestic',
            'options' => [
                'vpcMerchant' => '',
                'vpcAccessCode' => '',
                'vpcUser' => '',
                'vpcPassword' => '',
                'vpcHashKey' => '',
                'testMode' => false,
            ],
        ],
        'OnePayInternational' => [
            'driver' => 'OnePay_International',
            'options' => [
                'vpcMerchant' => '',
                'vpcAccessCode' => '',
                'vpcUser' => '',
                'vpcPassword' => '',
                'vpcHashKey' => '',
                'testMode' => false,
            ],
        ],
        'VTCPay' => [
            'driver' => 'VTCPay',
            'options' => [
                'websiteId' => '',
                'securityCode' => '',
                'testMode' => false,
            ],
        ],
        'VNPay' => [
            'driver' => 'VNPay',
            'options' => [
                'vnpTmnCode' => '',
                'vnpHashSecret' => '',
                'testMode' => false,
            ],
        ],
    ],
];
```

Cách sử dụng
------------

[](#cách-sử-dụng)

- [Cổng thanh toán MoMo](/docs/MoMo.md)
- [Cổng thanh toán OnePay](/docs/OnePay.md)
- [Cổng thanh toán VNPay](/docs/VNPay.md)
- [Cổng thanh toán VTCPay](/docs/VTCPay.md)

Dành cho nhà phát triển
-----------------------

[](#dành-cho-nhà-phát-triển)

Nếu như bạn cảm thấy thư viện chúng tôi còn thiếu sót hoặc sai sót và bạn muốn đóng góp để phát triển chung, chúng tôi rất hoan nghênh! Hãy tạo các `issue` để đóng góp ý tưởng cho phiên bản kế tiếp hoặc tạo `PR`để đóng góp phần thiếu sót hoặc sai sót. Riêng đối với các lỗi liên quan đến bảo mật thì phiền bạn gửi email đến  thay vì tạo issue. Cảm ơn!

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

2501d ago

### Community

Maintainers

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

---

Top Contributors

[![vuongxuongminh](https://avatars.githubusercontent.com/u/38932626?v=4)](https://github.com/vuongxuongminh "vuongxuongminh (18 commits)")

---

Tags

omnipaypayment-gatewayslaravel-omnipayphpvietvietnam-payment-gateways

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/peterzero-laravel-omnipay/health.svg)

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

###  Alternatives

[phpviet/laravel-omnipay

Laravel Omnipay hổ trợ tích hợp các cổng thanh toán trong nước.

987.7k](/packages/phpviet-laravel-omnipay)[ignited/laravel-omnipay

Integrates Omnipay with Laravel and provides an easy configuration.

5211.1M12](/packages/ignited-laravel-omnipay)[payum/payum-laravel-package

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

12842.5k](/packages/payum-payum-laravel-package)[recca0120/laravel-payum

Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more

741.5k](/packages/recca0120-laravel-payum)

PHPackages © 2026

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