qsnh / eshanghu-pay
eshanghu pay library.
This package's canonical repository appears to be gone and the package has been frozen as a result.
v3.0
2019-05-27 12:30 UTC
Requires
- php: >=7.1.3
- guzzlehttp/guzzle: ^6.3
This package is auto-updated.
Last update: 2020-05-27 15:09:30 UTC
README
注意,v2.1及之前版本对应易商户API的v1接口版本。
用法
首先,您需要安装依赖:
composer install
创建订单
<?php require_once '../vendor/autoload.php'; $config = require_once '../eshanghu.php'; $eshanghu = new \Eshanghu\Eshanghu($config); $outTradeNo = 'A123123'; $subject = '商品名称'; $totalFee = 1; // 单位:分 $extra = 'diy your self'; $response = $eshanghu->create($outTradeNo, $subject, $totalFee, $extra);
查询订单
<?php require_once '../vendor/autoload.php'; $config = require_once '../eshanghu.php'; $eshanghu = new \Eshanghu\Eshanghu($config); $outTradeNo = 'A123123123123'; $response = $eshanghu->queryUseOutTradeNo($outTradeNo); var_dump($response);