Scan2Pay
Scan2Pay is a simple and fast payment gateway for wechat and alipay, only support qr code / image scan, written in php.
Scan page snapshot:
Features
Use redis and local file to save data Small and quick User should input a short order number as payment remark You can update order status You can view orders by day, month, yearInstall
You need get PHP, php-pecl-redis, php-fpm, nginx and redis ready first.
Such as install commands in CentOS:
yum -y install php php-fpm php-pecl-redis nginx redis
Then follow the steps:
Download source code Replace the qr image with your wechat and alipay qr image in the directory:/www/img/
Create directory /runtime
and add write permission to php-fpm
Config your web server with a domain, example in Nginx.conf.md
That's all, now visit your domain to get start.
Config
Config file:
conf/appConfig.php
For developers
Order api
Http api to create new order and scan to pay.
Url:
api/createorder
Method:
POST
Parameters:
price - Amount of CN Yuan (RMB)
order_id - [optional] Id of the order
user_id - [optional] Id of the user
Http notify api
If you call api/createorder with pamameter order_id and there is notify url, the order status will post to the notify url when the order status is changing to paid or refund.
Url:
http(s)://yourdomain/notifyurl
Method:
POST
Parameters:
order_id - Id of the order
status - Status: paid / refund
user_id - [optional] Id of the user
App parameters
Parameter "USC::$app" and "$viewData" always can be used in the view file.
<?php
print_r(USC::$app);
print_r($viewData);
?>
Core class
Core class directory:
lib/
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。
3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考学习用!
4、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。