yaoliyong/think-withdraw
最新稳定版本:1.2.6
Composer 安装命令:
composer require yaoliyong/think-withdraw
包简介
withdraw terminal service api sdk for thinkphp
README 文档
README
如果觉得
think-withdraw不错,欢迎给个 star,谢谢。
目录结构
src/config/withdraw.php // 渠道配置文件,写好每个厂商的配置参数模版,记住是模版,不要把真实参数提交
src/dto/ // 接口数据传输对象
src/exception/ // 接口异常,不细分不需要再定义
src/extend/ // 接口扩展,你在对接时定义的工具类
src/provider/ // 接口服务提供者,一个厂商一个包,每个包里新建 `README.md` 文件,里面写厂商的接口文档
src/phpmate/ // 该目录下的文件未来将独立出去进行单独维护的,你不可以在此包下添加文件
使用方法
// 1. 在你的 tp 项目下面安装 `yaoliyong/think-withdraw` 包
composer require yaoliyong/think-withdraw
// 2. 项目根路径执行脚本,然后按照服务商的配置进行配置
php vendor/yaoliyong/think-withdraw/src/installer.php
// 3. 构建 withdraw 策略业务
$configParams = [];// 服务商配置参数
$WithdrawStrategy = WithdrawStrategyFactory::create('yunzhanghu', $configParams);
$requestDto = new CreateOrderRequestDto();
// 省略Dto设置参数
$WithdrawStrategy->createOrder($requestDto);
测试
vendor/bin/phpunit --filter "XzbPayTest::testQueryBalance" --configuration phpunit.xml vendor/bin/phpunit --filter "XzbPayTest::testUserSign" --configuration phpunit.xml vendor/bin/phpunit --filter "XzbPayTest::testCreateOrder" --configuration phpunit.xml vendor/bin/phpunit --filter "XzbPayTest::testQueryOrder" --configuration phpunit.xml vendor/bin/phpunit --filter "XzbPayTest::testHandleCallbackOfWithdraw" --configuration phpunit.xml
统计信息
- 总下载量: 54
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-25