Code Monkey home page Code Monkey logo

demo-php's Introduction

Demo tích hợp ZaloPay cho PHP

Demo tích hợp các API của ZaloPay cho PHP

  • Phiên bản: 1.0

Cài đặt

  1. Môi trường chạy PHP
    • Apache / Nginx + PHP 7.0 + Mysql hoặc XAMPP / WAMPP
  2. Tạo database zalopay_demo (utf8_unicode_ci)
  3. Tạo các bảng cần thiết bằng script sau
CREATE TABLE `orders` (
  `apptransid` varchar(255) NOT NULL,
  `zptransid` varchar(255),
  `description` varchar(255),
  `amount` BIGINT(20),
  `timestamp` BIGINT(20),
  `status` INT(3) DEFAULT 0,
  `channel` INT(11),
  PRIMARY KEY (`apptransid`)
);

CREATE TABLE `refunds` (
  `mrefundid` varchar(255),
  `zptransid` varchar(255),
  `amount` BIGINT(20),
  PRIMARY KEY (`mrefundid`)
);
  1. Config database trong file config.json
{
  "db": {
    "host": "<db-host>",
    "port": 3306,
    "dbname": "zalopay_demo",
    "user": "<db-username>",
    "password": "<db-password>"
  }
}
  1. Thay đổi app config trong config.json
{
  "appid": "<appid>",
  "key1": "<key1>",
  "key2": "<key2>"
}
  1. Thay đổi RSA public key trong publickey.pem
-----BEGIN PUBLIC KEY-----
xxxxxx (64 chars)
xxxxxx (64 chars)
-----END PUBLIC KEY-----

Các API tích hợp trong Demo

  • Xử lý callback
  • Xử lý Redirect
  • Thanh toán QR
  • Cổng ZaloPay
  • QuickPay
  • Mobile Web to App
  • Hoàn tiền
  • Lấy trạng thái đơn hàng
  • Lấy trạng thái hoàn tiền
  • Lấy danh sách ngân hàng

demo-php's People

Contributors

dungpqt avatar linhdmn 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.