PHPackages                             yiiviet/yii2-payment - 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. yiiviet/yii2-payment

ActiveYii2-extension[Payment Processing](/categories/payments)

yiiviet/yii2-payment
====================

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

1.0.4(7y ago)2460713[1 issues](https://github.com/yiiviet/yii2-payment/issues)BSD-3-ClausePHPPHP &gt;=7.1.0

Since May 16Pushed 5y ago4 watchersCompare

[ Source](https://github.com/yiiviet/yii2-payment)[ Packagist](https://packagist.org/packages/yiiviet/yii2-payment)[ RSS](/packages/yiiviet-yii2-payment/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (2)Versions (8)Used By (0)

YII2 Việt Nam Payment
=====================

[](#yii2-việt-nam-payment)

**Yii2 Extension hổ trợ bạn tích hợp các cổng thanh toán trong nước.**

[![Latest Stable Version](https://camo.githubusercontent.com/44d91c2d124f3827acf34a9c749e1e12624c7f4fbaf488818fe01be3ab370c90/68747470733a2f2f706f7365722e707567782e6f72672f796969766965742f796969322d7061796d656e742f762f737461626c65)](https://packagist.org/packages/yiiviet/yii2-payment)[![Total Downloads](https://camo.githubusercontent.com/6d58e28c4e95d560b09e0b15d2b2b5c47abbb950950a38c3cbe1253b720ae08e/68747470733a2f2f706f7365722e707567782e6f72672f796969766965742f796969322d7061796d656e742f646f776e6c6f616473)](https://packagist.org/packages/yiiviet/yii2-payment)[![Build Status](https://camo.githubusercontent.com/d279feda7bfa5aed4d2fa8fc1bff6478958019aa3b6a18838e965791196f2d79/68747470733a2f2f7472617669732d63692e6f72672f796969766965742f796969322d7061796d656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yiiviet/yii2-payment)[![Code Coverage](https://camo.githubusercontent.com/c91b59507c9724ee1305b9daf6b3ab526a702cabd7f26b3a1a48ec386f4a6734/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f796969766965742f796969322d7061796d656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/yiiviet/yii2-payment/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4d61800ebd6656f01e9788e6f3cfc7ca5ba02e18f45269d1e464b9dc15951637/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f796969766965742f796969322d7061796d656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/yiiviet/yii2-payment/?branch=master)[![Yii2](https://camo.githubusercontent.com/d6b0929173e28cc627430d2519ca1853466a70f37395877eaf4820cb3e1e1909/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f62792d5969695f4672616d65776f726b2d677265656e2e7376673f7374796c653d666c6174)](http://www.yiiframework.com/)

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 extension 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ế theo nguyên tắc [DRY](https://www.codehub.vn/Nguyen-Ly-DRY-Dont-Repeat-Yourself) 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, chính vì 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ụ:

```
$baoKim->purchase([
    'order_id' => 2,
    'total_amount' => 500000,
    'url_success' => '/'
]);

$nganLuong->purchase([
    'bank_code' => 'VCB',
    'buyer_fullname' => 'vxm',
    'buyer_email' => 'admin@test.app',
    'buyer_mobile' => '0909113911',
    'total_amount' => 10000000,
    'order_code' => microtime()
]);

$onePay->purchase([
    'ReturnURL' => 'http://localhost/',
    'OrderInfo' => time(),
    'Amount' => 500000,
    'TicketNo' => '127.0.0.1',
    'AgainLink' => 'http://localhost/',
    'Title' => 'Hello World',
    'MerchTxnRef' => time()
]);

$vnPayment->purchase([
    'TxnRef' => time(),
    'OrderType' => 100000,
    'OrderInfo' => time(),
    'IpAddr' => '127.0.0.1',
    'Amount' => 1000000,
    'ReturnUrl' => 'http://localhost'
]);

$vtcPay->purchase([
    'amount' => 100000,
    'reference_number' => time()
]);

$momo->purchase([
    'amount' => 100000,
    'orderId' => time(),
    'requestId' => time(),
    'returnUrl' => 'http://localhost',
    'notifyUrl' => 'http://localhost/notify',
]);
```

Các cổng thanh toán được hổ trợ:

- [Bảo Kim](https://baokim.vn)
- [Ngân Lượng](https://nganluong.vn)
- [OnePay](https://onepay.vn)
- [VnPayment](https://vnpayment.vn)
- [VTCPay](https://vtcpay.vn)
- [MoMo](https://momo.vn)

Yêu cầu
-------

[](#yêu-cầu)

- [PHP &gt;= 7.1](http://php.net)
- [PHP Extension: openSSL](http://pear.php.net) đối với Bảo Kim Pro
- [PHP Extension: curl](http://pear.php.net) đối với Bảo Kim
- [yiisoft/yii2 &gt;= 2.0.13](https://github.com/yiisoft/yii2/)
- [vxm/yii2-gateway-clients &gt;= 2.0.1](https://github.com/vuongxuongminh/yii2-gateway-clients)

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

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

Cài đặt thông qua `composer` nếu như đó là một khái niệm mới với bạn xin click vào [đây](http://getcomposer.org/download/) để tìm hiểu nó.

```
composer require "yiiviet/yii2-payment"
```

hoặc thêm

```
"yiiviet/yii2-payment": "*"
```

vào phần `require` trong file composer.json.

Tài liệu
--------

[](#tài-liệu)

- [Cổng thanh toán Bảo Kim](/docs/baokim.md).
- [Cổng thanh toán Ngân Lượng](/docs/nganluong.md).
- [Cổng thanh toán OnePay](/docs/onepay.md).
- [Cổng thanh toán VnPayment](/docs/vnpayment.md).
- [Cổng thanh toán VTCPay](/docs/vtcpay.md).
- [Cổng thanh toán MoMo](/docs/momo.md).
- [Tích hợp đồng thời nhiều cổng thanh toán](/docs/multi.md).
- [Khai báo VerifyFilter để lọc request](/docs/verifyfilter.md).
- [Bank Widget &amp; Validator](/docs/widgetvalidator.md).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

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 ~51 days

Recently: every ~60 days

Total

6

Last Release

2659d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8901d64a1059726b851dbdd91463ad1d3169f9dba6a2dcff11d05f97d9bccaea?d=identicon)[vuongxuongminh](/maintainers/vuongxuongminh)

---

Top Contributors

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

---

Tags

bao-kimintegrationsmomomomoapingan-luongomnipayonepayvnpaymentvtcpayyii2yii2-extensionyiivietyii2extensionvn-paymentone-paybao-kimngan-luongvtc-pay

### Embed Badge

![Health badge](/badges/yiiviet-yii2-payment/health.svg)

```
[![Health](https://phpackages.com/badges/yiiviet-yii2-payment/health.svg)](https://phpackages.com/packages/yiiviet-yii2-payment)
```

PHPackages © 2026

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