iepay/iepay-sdk
Composer 安装命令:
composer require iepay/iepay-sdk
包简介
Iepay PHP SDK version 3.x
README 文档
README
Iepay PHP SDK version 3.x APIs.
Installation / 安装
composer require iepay/iepay-sdk
Usage / 使用方法
Add environment config / 添加环境变量
MYPAY_ID={YOUR_IEPAY_ID} #IEPAY账号下的MID
MYPAY_KEY={YOUR_IEPAY_API_KEY} #IEPAY账号下的API-KEY
MYPAY_RETURN_URL={PAYMENT_SUCCESS_PAGE} #交易成功页面地址
MYPAY_NOTIFY_URL={PAYMENT_SUCCESS_NOTIFY_URL} #交易成功异步通知地址
Add namespace / 添加文件命名空间
use IEPaySDK\Payment;
Payment / 支付
$paymentType = 'IE0012'; // Payment Type see types table (支付类别,参考支付类别表)
$orderId = '20220210001'; // Your order id (随机生成的订单号)
$amount = 100; // Cent (分)
$subject = 'test subject'; // Item subject (商品标题)
$details = 'test details'; // Item details (商品详情)
$response = Payment::make($paymentType)->payment($orderId, $amount, $subject, $details);
Customise return URL or notify URL / 自定义返回链接
$returnUrl = 'https://xxx.xxx.xxx/return';
$notifyUrl = 'https://xxx.xxx.xxx/notify';
$response = Payment::make($paymentType, $returnUrl, $notifyUrl)->payment($orderId, $amount, $subject, $details);
Response / 返回值
{
"success": true,
"status": true,
"error_code": 0,
"message": "OK",
"data": {
"pay_type": "IE0012",
"pay_type_str": "Alipay Web",
"out_trade_no": "20220210001",
"trade_no": null,
"amount": 102,
"status": 0,
"status_str": "Unpay",
"pay_url": "https://intlmapi.alipay.com/gateway.do?xxxxxxxx=xxxxxxxx&xxxxxxxx=xxxxxxxx"
}
}
{
"success": true,
"status": true,
"error_code": 0,
"message": "OK",
"data": {
"pay_type": "IE0026",
"pay_type_str": "Wechat Mini",
"out_trade_no": "20220210001",
"trade_no": null,
"amount": 102,
"status": 0,
"status_str": "Unpay",
"pay_param": {
"appId": "wx123123",
"timeStamp": 1644978320,
"nonceStr": "cpxg8dl123123mi4oysnfx",
"package": "prepay_id=wx123456",
"signType": "MD5",
"paySign": "96DB44xxxxxxxxxxx"
},
"pay_url": null
}
}
Query / 查询
$paymentType = 'IE0012'; // Payment Type see types table (支付类别,参考支付类别表)
$orderId = '20220210001'; // Your order id (需要查询的订单号)
$response = Payment::make($paymentType)->query($orderId);
Response / 返回值
{
"success": true,
"status": true,
"error_code": 0,
"message": "OK",
"data": {
"pay_type": "IE0061",
"pay_type_str": "Windcave Host Page Payment",
"out_trade_no": "20220210005",
"trade_no": "000001011336275001f9e4140da76641",
"amount": 101,
"status": 1,
"status_str": "Paid",
"refunded_amount": 0,
"pay_url": "https://sec.windcave.com/pxmi3/F7F7CF323F53968E56CA0650BE713B347D965FA2CC2827399D145DE371986332500051BD83B6BCC7B8D21D53BAB554800"
}
}
{
"success": true,
"status": true,
"error_code": 0,
"message": "OK",
"data": {
"pay_type": "IE0026",
"pay_type_str": "Wechat Mini",
"out_trade_no": "20220210001",
"trade_no": null,
"amount": 102,
"status": 0,
"status_str": "Unpay",
"pay_param": {
"appId": "wx123123",
"timeStamp": 1644978320,
"nonceStr": "cpxg8dl123123mi4oysnfx",
"package": "prepay_id=wx123456",
"signType": "MD5",
"paySign": "96DB44xxxxxxxxxxx"
},
"pay_url": null
}
}
Refund / 退款
$paymentType = 'IE0012'; // Payment Type see types table (支付类别,参考支付类别表)
$orderId = '20220210001'; // Your order id (需要退款的订单号)
$amount = 100; // Cent (分)
$response = Payment::make($paymentType)->refund($orderId, $amount);
Response / 返回值
{
"success": true,
"status": true,
"error_code": 0,
"message": "OK",
"data": {
"pay_type": "IE0061",
"pay_type_str": "Windcave Host Page Payment",
"out_trade_no": "20220210005",
"trade_no": "000001011336275001f9e4140da76641",
"amount": 101,
"status": 2,
"status_str": "Refund",
"refunded": 10
}
}
Pay Type Table / 支付类别表
| Code | Pay Types | Desc | Status |
|---|---|---|---|
| IE0012 | Alipay Online PC Qrcode | 支付宝PC二维码(PC收银页面) | 已开通 |
| IE0013 | Alipay Online Wap Qrcode | 支付宝H5手机端二维码(Wap 收银页面) | 已开通 |
| IE0015 | Alipay App Direct | 支付宝In-APP支付(native开发,需接入支付宝APP-SDK) | 已开通 |
| IE0021 | Wechat PC Qrcode | 微信PC二维码 | 已开通 |
| IE0022 | Wechat Wap Qrcode | 微信WAP支付 | 已开通 |
| IE0025 | Wechat App Direct | 微信In-APP支付 | 已开通 |
| IE0026 | Wechat Mini Direct | 微信小程序支付 | 已开通 |
| IE0036 | Union Secure Online Payment | 银联Secure线上支付 | 新开通 |
| IE0041 | POLI Pay | POLI PC 支付 | 已开通 |
| IE0061 | Windcave Host Page Payment | Windcave PC 支付 | 即将开通 |
iepay/iepay-sdk 适用场景与选型建议
iepay/iepay-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 37 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 01 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 iepay/iepay-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 iepay/iepay-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 37
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-23