银联商务天满服务平台
Java PHP Python



public class OpenApiSdkTest {
    public static void main(String[] args) throws Exception{
        String url = "https://api-mop.chinaums.com/v1/inip/corporate-wallet/wechat-pay-point/order/pay";
        //开发者ID
        String appId = "平台分配";
        //开发者秘钥
        String appKey = "平台分配";
        //实例化客户端
        ConfigBean configBean = new ConfigBean();
        OpenApiContext context = new OpenApiContext();
        String request = "{\"requestTimestamp\":\"\",
                    \"merOrderId\":\"\",
                    \"fenOrderId\":\"\",
                    \"serviceId\":\"\",
                    \"mid\":\"\",
                    \"tid\":\"\",
                    \"totalAmount\":\"\",
                    \"srcReserve\":\"\",
                    \"attachedData\":\"\",
                    \"goodsTag\":\"\",
                    \"originalAmount\":\"\",
                    \"notifyUrl\":\"\",
                    \"systemId\":\"\",
                    \"subOpenId\":\"\",
                    \"subAppId\":\"\",
                    \"tradeScene\":\"\",
                    \"asynDivisionFlag\":\"\",
                    \"openId\":\"\"}";
        context.setStartTime(System.currentTimeMillis());
        context.setRequestId(UUID.randomUUID().toString().replace("-", ""));
        context.setOpenServUrl(url.split("/v")[0].concat("/"));
        context.setApiServiceUrl(url);
        context.setVersion(url.split("/")[3]);
        context.setAppId(appId);
        context.setAppKey(appKey);
        context.setConfigBean(configBean);
        context.setServiceCode(url.split("/v")[1].substring(1));
        OpenApiCache.getCurrentToken(context);
        System.out.println(HttpTransport.getInstance().doPost(context, request));
    }
}
<?php
require_once "../utils/Log.php";
require_once "../utils/Tools.php";
require_once "../DefaultOpenApiClient.php";
class DataRequest

{
    public $url = "";
    public $serviceCode = "";
    public $apiVersion ="";
    public $needToken = true;
    public $needDataTag = false;
    public $data;

    function __construct($data, $url)
    {
        $this->data = $data;
        $apiVersion = preg_split("/[/]+/s",$url)[2];
        $this->apiVersion = $apiVersion;
        $serviceCode = strstr($url,$apiVersion);
        $this->url = strstr($url,"/".$apiVersion,true);
        $this->serviceCode = preg_replace("/^" . preg_quote($apiVersion, "/") . "/", "", $serviceCode);
    }
}

class DataDemo{
    public function main(){
        $appid = "平台分配";
        $appkey = "平台分配";
        $url = "https://api-mop.chinaums.com/v1/inip/corporate-wallet/wechat-pay-point/order/pay";
        $data = json_encode(array("requestTimestamp"=>"",
                    "merOrderId"=>"",
                    "fenOrderId"=>"",
                    "serviceId"=>"",
                    "mid"=>"",
                    "tid"=>"",
                    "totalAmount"=>"",
                    "srcReserve"=>"",
                    "attachedData"=>"",
                    "goodsTag"=>"",
                    "originalAmount"=>"",
                    "notifyUrl"=>"",
                    "systemId"=>"",
                    "subOpenId"=>"",
                    "subAppId"=>"",
                    "tradeScene"=>"",
                    "asynDivisionFlag"=>"",
                    "openId"=>""));
        $reqiest = new DataRequest($data,$url);
        $client = new DefaultOpenApiClient();
        $content = $client->execute($reqiest,$appid,$appkey);
        $obj = json_decode($content);
        print_r($obj->errCode);
        print_r($obj->errInfo);
    }
}
$p = new DataDemo();
$p->main();
?>
# -*- coding: utf-8 -*-
from webapi.DefaultOpenApiClient import DefaultOpenApiClient

url = "https://api-mop.chinaums.com/v1/inip/corporate-wallet/wechat-pay-point/order/pay"

class DataRequest(object):
    def __init__(self, data: dict) -> dict:
        self.data = data
        self.serviceCode = url[len(url.split("/v")[0])+len(url.split("/")[3])+1: len(url)]
        self.apiVersion = url.split("/")[3]
        self.needToken = True
        self.needDataTag = True

appId="平台分配"
appKey="平台分配"
client = DefaultOpenApiClient(appId, appKey)
cls = DataRequest({\"requestTimestamp\":\"\",
                    \"merOrderId\":\"\",
                    \"fenOrderId\":\"\",
                    \"serviceId\":\"\",
                    \"mid\":\"\",
                    \"tid\":\"\",
                    \"totalAmount\":\"\",
                    \"srcReserve\":\"\",
                    \"attachedData\":\"\",
                    \"goodsTag\":\"\",
                    \"originalAmount\":\"\",
                    \"notifyUrl\":\"\",
                    \"systemId\":\"\",
                    \"subOpenId\":\"\",
                    \"subAppId\":\"\",
                    \"tradeScene\":\"\",
                    \"asynDivisionFlag\":\"\",
                    \"openId\":\"\"})
response = client.execute(cls)
print(str(response.get("data")))
print(response.get("errCode"))
print(response.get("errInfo"))
print(response.get("resultCode"))
print(response.get("resultInfo"))

支付分订单代扣下单

URL

  • 生产环境: POST https://api-mop.chinaums.com/v1/inip/corporate-wallet/wechat-pay-point/order/pay
  • 测试环境: POST https://test-api-open.chinaums.com/v1/inip/corporate-wallet/wechat-pay-point/order/pay

描述:若发起”支付分订单代扣下单“后,发起订单查询时交易状态为支付失败或收到代扣失败结果通知时,需更换商户订单号重试”支付分订单代扣下单“,直至扣款成功为止。根据微信官方指引,建议商户按照每4小时调用一次的频率来执行重试,保证信用订单能持续进行催收。

ContentType:application/json

请求头

名称 必填 描述 示例值
Authorization 认证内容 (认证参考天满开发者中心->接入指引->平台认证方式:开发者中心 OPEN-BODY-SIG AppId="****",Timestamp="20170606135700",Nonce="99930a147f5353dd8a8f29a5329f37e9",Signature="IPmdGHYCcfN+mto0/02zkwoUF1NT3YqPKaUykMaec1T="

请求参数

名称 类型 必填 最大长度 描述 示例值
requestTimestamp string - 报文请求时间,格式yyyy-MM-dd HH:mm:ss
merOrderId string 6-32 商户订单号 商户自行生成 注意:长度不要超过32位。
fenOrderId string 32 支付分订单号
serviceId string 32 服务ID 用于登记扣款信息
mid string 8-32 商户号
tid string 2-32 终端号
totalAmount number 1000000000 支付总金额,单位分 若divisionFlag为M,则: totalAmount=subOrders字段中的所有totalAmount值之和 加上 platformAmount值=goods中的所有subOrderAmount值之和。
srcReserve string 255 请求系统预留字段
attachedData string 255 商户附加数据
goodsTag string 32 商品标记,用于优惠活动
originalAmount number 1000000000 订单原始金额,单位分,用于记录前端系统打折前的金额
notifyUrl string 255 支付结果通知地址
systemId string 32 系统ID
subOpenId string - 用户子标识 openId和subOpenId至少选择其一,subOpenId和subAppId成对上送.
subAppId string 32 微信分配的子商户公众账号 ID openId和subOpenId至少选择其一,subOpenId和subAppId成对上送.
tradeScene string 32 交易场景 交易场景的取值包括: 1、车场停车场场景:PARKING 2、车位停车场:PARKING_SPACE 3、加油场景:GAS 4、高速场景:HIGHWAY 5、路桥场景:BRIDGE 6、生活缴费行业:LIFE_PAY 7、共享单车:SHARABLE_BIKE 8、共享充电宝:SHARABLE_CHARGERS 9、电商:E-COMMERCE 10:、OTHERS:其他
asynDivisionFlag boolean - 异步分账标记 若为M,则goods字段和subOrders字段不能同时为空; 且secureTransaction字段上送O或不上送。 退货订单不允许做子订单操作 已确认的子订单,不允许隔天再确认
openId string - 用户标识 openId和subOpenId至少选择其一,subOpenId和subAppId成对上送.

响应示例

{
  "respCode":"",
  "respDesc":"",
  "responseTimeStamp":"",
  "mid":"",
  "tid":"",
  "srcReserve":"",
  "merName":"",
  "merOrderId":"",
  "seqId":"",
  "status":"",
  "totalAmount":0,
  "targetOrderId":"",
  "targetSys":"",
  "yxlmAmount":0
}

响应参数

名称 类型 必填 最大长度 描述 示例值
respCode string - 错误码
respDesc string - 错误信息
responseTimeStamp string 64 报文应答时间,格式yyyy-MM-dd HH:mm:ss
mid string 64 商户号,原样返回
tid string 64 终端号,原样返回
srcReserve string 64 请求系统预留字段
merName string 64 商户名称
merOrderId string 64 商户订单号
seqId string 64 平台流水号,类似检索参考号
status string 64 交易状态
totalAmount number 64 支付总金额
targetOrderId string 64 第三方订单号
targetSys string 64 目标平台代码
yxlmAmount number 64 营销联盟优惠金额 仅享受联盟优惠的订单,查询返回

错误码