Code Monkey home page Code Monkey logo

yii2-payment's Introduction

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 Total Downloads Build Status Code Coverage Scrutinizer Code Quality Yii2

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 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' => '[email protected]',
    '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ợ:

Yêu cầu

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 để 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

yii2-payment's People

Contributors

vuongxuongminh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.