PHP code example of zqzl / mofxsdk
1. Go to this page and download the library: Download zqzl/mofxsdk library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zqzl / mofxsdk example snippets
$dispatch = new \Zqzl\Mofxsdk\Dispatch([
'token' => '123',
'debug' => true,
'log' => [
'name' => 'mofx',
'file' => __DIR__ . '/mofx.log',
'level' => 'debug',
'permission' => 0777,
],
]);
$params = [];
// 获取token
$result = $dispatch->getToken($params);
// 获取商品列表
$result = $dispatch->goodList($params);
// 获取商品详情
$result = $dispatch->goodInfo($params);
// 创建订单
$result = $dispatch->createOrder($params);
// 订单支付
$result = $dispatch->pay($params);