Iepay PHP SDK version 3.x APIs.
composer require iepay/iepay-sdk
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} #交易成功异步通知地址
use IEPaySDK\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);
$returnUrl = 'https://xxx.xxx.xxx/return';
$notifyUrl = 'https://xxx.xxx.xxx/notify';
$response = Payment::make($paymentType, $returnUrl, $notifyUrl)->payment($orderId, $amount, $subject, $details);
{
"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
}
}
$paymentType = 'IE0012'; // Payment Type see types table (支付类别,参考支付类别表)
$orderId = '20220210001'; // Your order id (需要查询的订单号)
$response = Payment::make($paymentType)->query($orderId);
{
"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
}
}
$paymentType = 'IE0012'; // Payment Type see types table (支付类别,参考支付类别表)
$orderId = '20220210001'; // Your order id (需要退款的订单号)
$amount = 100; // Cent (分)
$response = Payment::make($paymentType)->refund($orderId, $amount);
{
"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
}
}
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 | 微信小程序支付 | 已开通 |
IE0027 | Wechat H5 | 微信外h5唤起微信支付 | 已开通 |
IE0036 | Union Secure Online Payment | 银联Secure线上支付 | 新开通 |
IE0041 | POLI Pay | POLI PC 支付 | 已开通 |
IE0061 | Windcave Host Page Payment | Windcave PC 支付 | 即将开通 |
TIP
When using the WeChat Pay H5 payment feature, please follow these configuration requirements:
Domain Configuration:
http
or https
, for example: xxx.qq.com
.H5 Page Configuration:
Please adhere strictly to the above requirements to ensure the proper functioning of the WeChat Pay H5 payment feature.