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



import com.chinaums.open.api.OpenApiCache;
import com.chinaums.open.api.OpenApiContext;
import com.chinaums.open.api.constants.ConfigBean;
import com.chinaums.open.api.internal.util.http.HttpTransport;
import java.util.UUID;

public class OpenApiSdkTest {
    public static void main(String[] args) throws Exception{
        String url = "https://api-mop.chinaums.com取账单上的notifyUrl值";
        //开发者ID
        String appId = "平台分配";
        //开发者秘钥
        String appKey = "平台分配";
        //实例化客户端
        ConfigBean configBean = new ConfigBean();
        OpenApiContext context = new OpenApiContext();
        String request = "{\"bankInfo\":\"\",
                    \"couponAmount\":\"\",
                    \"buyerPayAmount\":\"\",
                    \"payTime\":\"\",
                    \"notifyId\":\"\",
                    \"mid\":\"89846017299APP4\",
                    \"tid\":\"C9FNU8V6\",
                    \"attachedData\":\"\",
                    \"bankCardNo\":\"\",
                    \"billFunds\":\"\",
                    \"billFundsDesc\":\"\",
                    \"buyerId\":\"\",
                    \"buyerUsername\":\"\",
                    \"totalAmount\":\"\",
                    \"invoiceAmount\":\"\",
                    \"merOrderId\":\"\",
                    \"refId\":\"\",
                    \"refundAmount\":\"\",
                    \"refundDesc\":\"\",
                    \"seqId\":\"\",
                    \"settleDate\":\"\",
                    \"status\":\"\",
                    \"subBuyerId\":\"\",
                    \"targetOrderId\":\"\",
                    \"targetSys\":\"\",
                    \"paymentTrxId\":\"\",
                    \"paymentRotType\":\"\"}";
        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取账单上的notifyUrl值";
        $data = json_encode(array("bankInfo"=>"",
                    "couponAmount"=>"",
                    "buyerPayAmount"=>"",
                    "payTime"=>"",
                    "notifyId"=>"",
                    "mid"=>"89846017299APP4",
                    "tid"=>"C9FNU8V6",
                    "attachedData"=>"",
                    "bankCardNo"=>"",
                    "billFunds"=>"",
                    "billFundsDesc"=>"",
                    "buyerId"=>"",
                    "buyerUsername"=>"",
                    "totalAmount"=>"",
                    "invoiceAmount"=>"",
                    "merOrderId"=>"",
                    "refId"=>"",
                    "refundAmount"=>"",
                    "refundDesc"=>"",
                    "seqId"=>"",
                    "settleDate"=>"",
                    "status"=>"",
                    "subBuyerId"=>"",
                    "targetOrderId"=>"",
                    "targetSys"=>"",
                    "paymentTrxId"=>"",
                    "paymentRotType"=>""));
        $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取账单上的notifyUrl值"

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({\"bankInfo\":\"\",
                    \"couponAmount\":\"\",
                    \"buyerPayAmount\":\"\",
                    \"payTime\":\"\",
                    \"notifyId\":\"\",
                    \"mid\":\"89846017299APP4\",
                    \"tid\":\"C9FNU8V6\",
                    \"attachedData\":\"\",
                    \"bankCardNo\":\"\",
                    \"billFunds\":\"\",
                    \"billFundsDesc\":\"\",
                    \"buyerId\":\"\",
                    \"buyerUsername\":\"\",
                    \"totalAmount\":\"\",
                    \"invoiceAmount\":\"\",
                    \"merOrderId\":\"\",
                    \"refId\":\"\",
                    \"refundAmount\":\"\",
                    \"refundDesc\":\"\",
                    \"seqId\":\"\",
                    \"settleDate\":\"\",
                    \"status\":\"\",
                    \"subBuyerId\":\"\",
                    \"targetOrderId\":\"\",
                    \"targetSys\":\"\",
                    \"paymentTrxId\":\"\",
                    \"paymentRotType\":\"\"})
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取账单上的notifyUrl值
  • 测试环境: POST https://test-api-open.chinaums.com取账单上的notifyUrl值

描述:支付结果通知

ContentType:HTTP(S)

请求参数

名称 类型 必填 最大长度 描述 示例值
bankInfo string 银行信息
couponAmount number 网付计算的优惠金额
buyerPayAmount number 实付金额
payTime string 支付时间 格式yyyy-MM-dd HH:mm:ss
notifyId string 支付通知ID 通知唯一ID,重发通知的notifyId不变
mid string 商户号 89846017299APP4
tid string 终端号 C9FNU8V6
attachedData string 附加数据
bankCardNo string 支付银行信息
billFunds string 资金渠道
billFundsDesc string 资金渠道说明
buyerId string 买家ID
buyerUsername string 买家用户名
totalAmount number 订单金额,单位分
invoiceAmount number 开票金额
merOrderId string 商户订单号
refId string 支付银行卡参考号
refundAmount number 退款金额 退货交易
refundDesc string 退款说明 退货交易
seqId string 系统交易流水号
settleDate string 结算日期 格式yyyy-MM-dd
status string 订单状态 取值说明
subBuyerId string 卖家子ID
targetOrderId string 渠道订单号
targetSys string 支付渠道 取值说明
paymentTrxId string - 支付交易标识号
paymentRotType string - 支付交易通道类型

响应示例

{

}

响应参数

错误码