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/v1/inip/sign/uac/entrust-pay/rescission";
//开发者ID
String appId = "平台分配";
//开发者秘钥
String appKey = "平台分配";
//实例化客户端
ConfigBean configBean = new ConfigBean();
OpenApiContext context = new OpenApiContext();
String request = "{\"requestTimestamp\":\"2023-06-08 11:07:06\",
\"mid\":\"898100054115259\",
\"planId\":\"d2041b5c28474a2c9bb8b70128d71160\",
\"contractId\":\"202306081107062957522742\"}";
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/sign/uac/entrust-pay/rescission";
$data = json_encode(array("requestTimestamp"=>"2023-06-08 11=>07=>06",
"mid"=>"898100054115259",
"planId"=>"d2041b5c28474a2c9bb8b70128d71160",
"contractId"=>"202306081107062957522742"));
$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/sign/uac/entrust-pay/rescission"
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\":\"2023-06-08 11:07:06\",
\"mid\":\"898100054115259\",
\"planId\":\"d2041b5c28474a2c9bb8b70128d71160\",
\"contractId\":\"202306081107062957522742\"})
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/sign/uac/entrust-pay/rescission - 测试环境:
POST
https://test-api-open.chinaums.com/v1/inip/sign/uac/entrust-pay/rescission
描述:解约
ContentType:HTTP(S)
请求头
名称 | 必填 | 描述 | 示例值 |
---|---|---|---|
Authorization | 是 | 认证内容(认证参考天满开发者中心->接入指引->平台认证方式:开发者中心 ) |
请求参数
名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
---|---|---|---|---|---|
requestTimestamp | string | 是 | 19 | 报文请求时间 格式yyyy-MM-dd HH:mm:ss | 2023-06-08 11:07:06 |
mid | string | 是 | 15 | 商户代码 银商商户号 | 898100054115259 |
planId | string | 是 | 1-32 | 协议模板id 无感(免密极速)产品模板 ID,与接入产品对应。 | d2041b5c28474a2c9bb8b70128d71160 |
contractId | string | 是 | 44 | 银商免密支付签约协议号 云闪付侧的签约协议号,由银联生成。即标记化支付信息域的token。BASE64加密。 | 202306081107062957522742 |
响应示例
{
"errCode":"",
"errMsg":""
}
响应参数
名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
---|---|---|---|---|---|
errCode | string | 是 | <=64 | 错误代码 平台错误码 业务错误码 |
|
errMsg | string | 否 | <=255 | 错误信息 |