Giter VIP home page Giter VIP logo

ws-momo's Introduction

Tải về

  • Tải plugin về và giải nén vào thư mục gốc của Wordpress (cùng cấp với wp-content, wp-admin)
  • Tên thư mục sau khi giải nén phải là ws-momo
  • Tạo file wp-content/plugins/ws-momo-plugin.php với nội dung
<?php
/**
 * Plugin name: WpStarter Momo Payment
 * Plugin URI: https://github.com/wpstarter/ws-momo
 * Description: Phương thức thanh toán momo
 * Author: WpStarter
 * Author URI: https://wpstarter.dev
 */

if(file_exists(ABSPATH.'/ws-momo/main.php')){
    require_once ABSPATH.'/ws-momo/main.php';
}else{
    echo "Không tìm thấy file plugin ".ABSPATH.'/ws-momo/main.php';
}
  • Cấu trúc thư mục trông sẽ như sau
.                                          
├── wp-admin
├── wp-content
│   ├── plugins
│   │   ├── ws-momo-plugin.php
│   └── ...                                             
├── wp-includes
├── ws-momo
│   ├── app
│   ├── bootstrap                   
│   └── ...
└── ...

Cài đặt

Hãy di chuyển vào thư mục ws-momo và chạy các lệnh sau để cài đặt

composer install
php -r "file_exists('.env') || copy('.env.example', '.env');"
php artisan key:generate --ansi
php artisan migrate

Kết nối momo:

php artisan momo connect

Kích hoạt plugin và bật phương thức thanh toán ở woocommerce

Cài cronjob

Để hệ thống tự động update order ngay cả khi người dùng tắt trình duyệt thì cần cài cronjob như sau

* * * * * cd /path-to-ws-momo && php artisan schedule:run >> /dev/null 2>&1

Cấu hình

Bạn có thể thay đổi cấu hình ở file config/banking.php

'rate'=>20000,
'prefix'=>[
    'invoice'=>'Momo'
],

Bạn có thể đặt tỉ giá nếu loại tiền tệ thanh toán trên website không phải VNĐ

Bạn có thể thay đổi mã hóa đơn Momo thành 1 chuỗi khác, khi đó nội dung chuyển tiền sẽ có dạng {prefix}+orderid

Hỗ trợ

Cần hỗ trợ thêm thông tin vui lòng đặt câu hỏi tại group https://www.facebook.com/groups/wpstarter

ws-momo's People

Contributors

4iteam 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.