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



public class OpenApiSdkTest {
    public static void main(String[] args) throws Exception{
        String url = "https://api-mop.chinaums.com/";
        //开发者ID
        String appId = "平台分配";
        //开发者秘钥
        String appKey = "平台分配";
        //实例化客户端
        ConfigBean configBean = new ConfigBean();
        OpenApiContext context = new OpenApiContext();
        String request = "";
        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/";
        $data = json_encode(array());
        $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/"

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()
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

  • 生产环境: `` https://api-mop.chinaums.com/
  • 测试环境: `` https://test-api-open.chinaums.com/

描述:

ContentType:

请求参数

响应示例

{
  "msgId":"",
  "msgType":"",
  "msgSrc":"",
  "srcReserve":"",
  "responseTimestamp":"",
  "mid":"",
  "tid":"",
  "seqId":"",
  "settleRefId":"",
  "refId":"",
  "status":"",
  "totalAmount":0,
  "merName":"",
  "merOrderId":"",
  "targetOrderId":"",
  "targetSys":"",
  "targetStatus":"",
  "buyerId":"",
  "targetMid":"",
  "bankCardNo":"",
  "bankInfo":"",
  "billFunds":"",
  "billFundsDesc":"",
  "buyerPayAmount":0,
  "buyerUsername":"",
  "couponAmount":0,
  "invoiceAmount":0,
  "payTime":"",
  "receiptAmount":0,
  "settleDate":"",
  "subBuyerId":"",
  "activityIds":"",
  "yxlmAmount":0,
  "buyerCashPayAmt":0,
  "couponMerchantContribute":0,
  "couponOtherContribute":0,
  "signType":"",
  "sign":"",
  "fenOrderId":""
}

响应参数

名称 类型 必填 最大长度 描述 示例值
msgId string 64 消息ID
msgType string 32 消息类型
msgSrc string 255 消息来源
srcReserve string - 请求系统预留字段
responseTimestamp string - 报文响应时间,格式yyyy-MM-dd HH:mm:ss
mid string - 商户号
tid string - 终端号
seqId string - 平台流水号,类似检索参考号
settleRefId string - 清分ID,如果来源方传了bankRefId就等于bankRefId,否则等于seqId
refId string - 检索参考号,用在银联体系交易中
status string - 交易状态
totalAmount number - 支付总金额
merName string - 商户名称
merOrderId string - 商户订单号
targetOrderId string - 第三方订单号
targetSys string - 目标平台代码
targetStatus string - 目标平台的状态
buyerId string - 买家ID
targetMid string - 支付渠道商户号,各渠道情况不同,酌情转换。
bankCardNo string - 银行卡号,如果有的话
bankInfo string - 银行信息
billFunds string - 支付渠道列表 示例:支付宝余额:33 优惠券:55
billFundsDesc string - 支付渠道描述
buyerPayAmount number - 买家付款的金额,支付宝会有
buyerUsername string - 买家用户名
couponAmount number - 网付计算的优惠金额
invoiceAmount number - 交易中可给用户开具发票的金额
payTime string - 支付时间,格式yyyy-MM-dd HH:mm:ss
receiptAmount number - 商户实收金额,支付宝会有
settleDate string - 结算日期,格式yyyy-MM-dd
subBuyerId string - 子买家ID,比如微信的subOpenId
activityIds string - 微信活动ID
yxlmAmount number - 营销联盟优惠金额 仅享受联盟优惠的订单,查询返回
buyerCashPayAmt number - 实付现金金额
couponMerchantContribute number - 商户出资优惠金额 目前支持微信返回,其他渠道产品规划中
couponOtherContribute number - 其他出资优惠金额 目前支持微信返回,其他渠道产品规划中
signType string - 签名算法
sign string - 签名
fenOrderId string 32 支付分订单号

错误码