商户App集成IOTPay
基本流程
在App集成场景下,有4个参与的系统:
1, 商家的App
2, 商家的后台系统
3, IOTPay的API服务
4, 微信支付/支付宝/银联的服务
对于商户APP,商户发送支付请求到支付中心后,支付中心向商户返回加密数据且不向三方支付发送消息。商户利用接收到的加密数据调用三方支付的SDK,向三方支付发起支付请求。当支付中心收到三方支付 的支付消息后,支付中心通知商户支付结果。

商家App调用商家后台API
该API由商家自行定义,可参考的基本例子如下:
服务地址: https://merchant_server/pay?channelid=XXX&amount=xxx
- 请求方式: GET
商家后台收到App调用后,向IOTPay发起下单。
App支付需指定ChannelId如下:
| 渠道ID | 渠道名称 |
|---|---|
| WX_APP | 商户APP微信支付 |
| ALIPAY_MOBILE | 商户APP支付宝支付 |
| UPI_APP | 银联SecurePay |
注意:支付宝APP已不再支持官方SDK唤起支付。请使用以下流程图的方式集成

商家后台调用统一下单接口
请求URL
服务地址: https://api.iotpaycloud.com/v1/create_order
请求方式:
- POST
- Content-Type: application/x-www-form-urlencoded

参数说明
| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 |
|---|---|---|---|---|---|
| 商户ID | mchId | 是 | String(30) | 10000701 | 支付中心分配的商户号 |
| 商户订单号 | mchOrderNo | 是 | String(30) | 20160427210604000490 | 商户生成的订单号,请保证唯一性 |
| 渠道ID | channelId | 是 | String(24) | ALIPAY_MOBILE | 见支付渠道参数 |
| 币种 | currency | 是 | String(3) | CAD | 三位货币代码,仅支持加币:CAD和美金:USD |
| 支付金额 | amount | 是 | int | 100 | 支付金额,单位分 |
| 客户端IP | clientIp | 是 | String(32) | 210.73.10.148 | 客户端IP地址 |
| 设备 | device | 否 | String(64) | WEB | 终端设备号(门店号或收银设备ID),注意:PC网页或公众号内支付请传"WEB" |
| 移动端OS | osType | 否 | String(10) | IOS | ALIPAY_MOBILE和ALIPAY_WAP必填!可选值:IOS, ANDROID |
| 结束跳转URL | returnUrl | 否 | String(200) | WX_JSAPI, ALIPAY_PC, ALIPAY_WAP, ALIPAY_MOBILE需要 | 支付结束跳转URL,勿包含? |
| 支付结果回调URL | notifyUrl | 是 | String(200) | http://xxx.com/notify.php | 支付结果回调URL |
| 商品主题 | subject | 是 | String(64) | 测试商品 | 商品主题 |
| 商品描述信息 | body | 是 | String(255) | xxpay测试商品描述 | 商品描述信息 |
| 扩展参数1 | param1 | 否 | String(64) | 支付中心回调时会原样返回 | |
| 扩展参数2 | param2 | 否 | String(64) | 支付中心回调时会原样返回 | |
| 附加参数 | extra | 是 | String(512) | {"type":"apppay","appId":"xxxxxxxxx"} | appId从微信开放平台获取 |
| 子账号 | jobNo | 是 | String(50) | 商户登录名 | |
| 附言 | remarks | 否 | String(200) | 商户的附言 | |
| 签名 | sign | 是 | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | 签名值,详见签名算法 |
微信App支付(WX_APP)
提示
您可以在微信开放平台注册一个账号并登记您的应用程序来获得您的appId。
| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 |
|---|---|---|---|---|---|
| 附加参数 | extra | 是 | JSON | {"type":"apppay","appId":"xxxxxxxxx"} |
支付宝App支付(ALIPAY_MOBILE) 或者 UPI_APP(银联SecurePay)
| 字段名 | 变量名 | 必填 | 类型 | 示例值 | 描述 |
|---|---|---|---|---|---|
| 附加参数 | extra | 否 | JSON | 该参数不用传 |
php代码示例
require_once('Utility.php');
$url = 'http://api.iotpaycloud.com/v1/create_order';
$merchantId = '1000####';
$merchantKey = '##############################';
$channelId = $_REQUEST['channelid'];
$orderAmount = $_REQUEST['amount'];
$orderNo = $_SERVER['REQUEST_TIME'];
$Utility = new Utility();
$ip = $Utility->real_ip();
$notifyUrl = 'https://develop.iotpay.ca/demo/order/notify.php';
$subject = 'test';
$body = 'payTest';
$extra = '';
if($channelId =='WX_APP')
{
$appId = 'wxxxxxxxxxxxxxx';
$type = 'apppay';
$extra = json_encode(array(
'type' => $type,
'appId' => $appId,
));
}
$arr = array(
'mchId' => $merchantId,
'mchOrderNo' => $orderNo,
'extra' => $extra,
'channelId' => $channelId,
'currency' => 'CAD',
'amount' => intval($orderAmount * 100),
'clientIp' => $ip,
'device' => 'WEB',
'notifyUrl' => $notifyUrl,
'subject' => $subject,
'body' => $body,
);
$sortArray = $Utility->arg_sort($arr);
$arr['sign'] = $Utility->build_mysign($sortArray, $merchantKey, "MD5");//Generate signature parameter sign
$param = 'params=' . json_encode($arr);
$resBody = $Utility->request($url, $param);//Submit to the gateway
$res = json_decode($resBody, true);
echo json_encode($res['payParams']); //client app use payParams to call sdk微信/支付宝的SDK和文档:
Demo源码
源码下载 下载
changelog
2026-03-10
- 新增必填字段
osType,当 channelId=ALIPAY_MOBILE , channelId=ALIPAY_WAP 时的 osType必填且值为 ANDROID 或 IOS - 返回值改动
返回值改动说明
channelId = ALIPAY_MOBILE
支付请求: 请求需要传字段 osType 为 ANDROID或IOS
返回结果处理: 注意: 已不能使用原orderStr的方式唤起支付宝支付, 需要改为用payParams(retParams.schemeUrl)或payParams(retParams.url)跳转方式唤起支付 payParams 为schemeUrl唤起支付宝支付 retDetail 为打开网页的方式唤起支付 若你的sdk支持tradeNo的方式,则可以使用retParams.tradeNo的方式唤起支付
返回结果对比: 原返回结果
{
"resCode": "SUCCESS",
"retCode": "SUCCESS",
"retParams": "service=\"mobile.securitypay.pay\"&partner=\"2088821558736584\"&out_trade_no=\"AA20260204145835078594034226\"&subject=\"testProduct\"&body=\"This is the description for the test product\"&total_fee=\"0.04\"¤cy=\"CAD\"&payment_type=\"1\"&product_code=\"NEW_WAP_OVERSEAS_SELLER\"&seller_id=\"2088821558736584\"¬ify_url=\"https://api.iotpaycloud.com/v1/alinotify\"&forex_biz=\"FP\"&it_b_pay=\"60m\"&secondary_merchant_id=\"344480625\"&secondary_merchant_name=\"IOT&PAY TECHNOLOGIES INC.\"&_input_charset=\"utf-8\"&sign=\"1jDCE7mrFu3BvmfMNsDqCGh%2B5gDblNbX8sZgB5Ex3PKi%2By1Vlec3DTaETpYP6jl%2FuRALV2dGcUs7jcwxL0uRQwkJZeXTLK1t22hbG6skr5mIfgiqkWaHdcLd%2BdG1q8x01CmQbYak3VGW8B4RZlzYHsS1lkdL%2BGlp8HdebYfQnFg%3D\"&sign_type=\"RSA\"",
"payOrderId": "AA20260204145835078594034226",
"mchOrderNo": "2329ccdd-3dc4-4cda-9db8-9e7830d462ee",
"retDetail": "service=\"mobile.securitypay.pay\"&partner=\"2088821558736584\"&out_trade_no=\"AA20260204145835078594034226\"&subject=\"testProduct\"&body=\"This is the description for the test product\"&total_fee=\"0.04\"¤cy=\"CAD\"&payment_type=\"1\"&product_code=\"NEW_WAP_OVERSEAS_SELLER\"&seller_id=\"2088821558736584\"¬ify_url=\"https://api.iotpaycloud.com/v1/alinotify\"&forex_biz=\"FP\"&it_b_pay=\"60m\"&secondary_merchant_id=\"344480625\"&secondary_merchant_name=\"IOT&PAY TECHNOLOGIES INC.\"&_input_charset=\"utf-8\"&sign=\"1jDCE7mrFu3BvmfMNsDqCGh%2B5gDblNbX8sZgB5Ex3PKi%2By1Vlec3DTaETpYP6jl%2FuRALV2dGcUs7jcwxL0uRQwkJZeXTLK1t22hbG6skr5mIfgiqkWaHdcLd%2BdG1q8x01CmQbYak3VGW8B4RZlzYHsS1lkdL%2BGlp8HdebYfQnFg%3D\"&sign_type=\"RSA\"",
"payParams": "service=\"mobile.securitypay.pay\"&partner=\"2088821558736584\"&out_trade_no=\"AA20260204145835078594034226\"&subject=\"testProduct\"&body=\"This is the description for the test product\"&total_fee=\"0.04\"¤cy=\"CAD\"&payment_type=\"1\"&product_code=\"NEW_WAP_OVERSEAS_SELLER\"&seller_id=\"2088821558736584\"¬ify_url=\"https://api.iotpaycloud.com/v1/alinotify\"&forex_biz=\"FP\"&it_b_pay=\"60m\"&secondary_merchant_id=\"344480625\"&secondary_merchant_name=\"IOT&PAY TECHNOLOGIES INC.\"&_input_charset=\"utf-8\"&sign=\"1jDCE7mrFu3BvmfMNsDqCGh%2B5gDblNbX8sZgB5Ex3PKi%2By1Vlec3DTaETpYP6jl%2FuRALV2dGcUs7jcwxL0uRQwkJZeXTLK1t22hbG6skr5mIfgiqkWaHdcLd%2BdG1q8x01CmQbYak3VGW8B4RZlzYHsS1lkdL%2BGlp8HdebYfQnFg%3D\"&sign_type=\"RSA\"",
"sign": "F1D60EDB111026FDC36DC39DD85B5E3C"
}新返回结果
{
"resCode": "SUCCESS",
"retCode": "SUCCESS",
"retParams": {
"url": "https://render.alipay.com/p/c/jzmcoal2/acn-wap-continue.html?url=alipayconnect%3a%2f%2fplatformapi%2facwallet%2falipayconnectcode%3fcode%3dgolcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox%26golSandbox%3dtrue%26pspName%3dALIPAY_CN&paymentId=20260204114010800190184000018685170&callback=https%3A%2F%2Fdev.iotpaycloud.com%2Fv1%2Fgalipayrtn%3Fpayorderid%3DAA20260204145804816118393649&amountValue=0.04&amountCurrency=CAD&county=US&merchantId=21841100000580I7&merchantName=IOT%26%2BPAY%20%E4%BD%A0%E5%A5%BD%20TECHNOLOGIES%20INC.&code=golcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox&referenceOrderId=b4ac8f53-a93f-4a82-8059-307644ce2166&paymentMethodType=ALIPAY_CN",
"schemeUrl": "alipayconnect://platformapi/acwallet/alipayconnectcode?code=golcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox&golSandbox=true&pspName=ALIPAY_CN",
"tradeNo": "20260204114010800190184000018685170"
},
"payOrderId": "AA20260204145804816118393649",
"mchOrderNo": "b4ac8f53-a93f-4a82-8059-307644ce2166",
"retDetail": "https://render.alipay.com/p/c/jzmcoal2/acn-wap-continue.html?url=alipayconnect%3a%2f%2fplatformapi%2facwallet%2falipayconnectcode%3fcode%3dgolcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox%26golSandbox%3dtrue%26pspName%3dALIPAY_CN&paymentId=20260204114010800190184000018685170&callback=https%3A%2F%2Fdev.iotpaycloud.com%2Fv1%2Fgalipayrtn%3Fpayorderid%3DAA20260204145804816118393649&amountValue=0.04&amountCurrency=CAD&county=US&merchantId=21841100000580I7&merchantName=IOT%26%2BPAY%20%E4%BD%A0%E5%A5%BD%20TECHNOLOGIES%20INC.&code=golcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox&referenceOrderId=b4ac8f53-a93f-4a82-8059-307644ce2166&paymentMethodType=ALIPAY_CN",
"payParams": "alipayconnect://platformapi/acwallet/alipayconnectcode?code=golcashier66511663-9a8f-4cea-b141-ec214bb9bd4asandbox&golSandbox=true&pspName=ALIPAY_CN",
"sign": "662F9DA3B1E7AF77A2AE016C60F6F660"
}请求示例
curl --location --request POST 'https://api.iotpaycloud.com/v1/create_order' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Accept: */*' \
--header 'Cache-Control: no-cache' \
--header 'Host: api.iotpaycloud.com' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: acw_tc=2f584a5017709191550335243ec00071ae250a5509c8bf3db46b6407f38bdd' \
--data-urlencode 'params={
"mchId": "10000576",
"mchOrderNo": "ef28ca74-f379-4a65-a246-c731d846d87b",
"jobNo": "abcde",
"currency": "CAD",
"channelId": "ALIPAY_MOBILE",
"amount": 4,
"returnUrl": "https://iottest.requestcatcher.com",
"notifyUrl": "https://gptest.requestcatcher.com",
"subject":"testProduct",
"body":"This is the description for the test product",
"clientIp": "192.168.50.127",
"osType":"ANDROID",
"sign": "3837C685A81FCEB91C6E182D8294FCFD"
}'