Yuansfer API 文档
搜索文档…
取消
post
https://mapi.yuansfer.com/app-data-search/v3
/cancel
cancel
响应
参数
类型
说明
result
object
结果对象
ret_msg
string
响应返回消息。
ret_code
string
响应返回码。 了解有关的更多详细信息,请参见此处

结果对象

参数
类型
说明
amount
number
交易金额。
currency
string
标识货币的三位字符货币代码。
可能的值为:“ USD” “ CNY”。
reference
string
商家系统中交易的发票编号。
status
string
退款状态。
transactionNo
string
基于Yuansfer系统中交易的退款交易ID。
cURL
PHP
Java
Go
curl -XPOST -H "Content-type: application/json" -d '{
"merchantNo": "200043",
"storeNo": "300014",
"verifySign": "dd81f7781603bec48ae2c6a9ac758bf2",
"transactionNo": "297553638301777927",
}' 'https://mapi.yuansfer.com/app-data-search/v3/cancel'
<?php
function transCancel()
{
$url = 'https://mapi.yuansfer.yunkeguan.com/app-data-search/v2/cancel';
$token = '59600f2a9ad644c6a9570233560cc94e';
$params = [
'merchantNo' => '200043',
'storeNo' => '300014',
'transactionNo' => '297553565108438359'
];
ksort($params, SORT_STRING);
$str = '';
foreach ($params as $k => $v) {
$str .= $k . '=' . $v . '&';
}
$params['verifySign'] = md5($str . md5($token));
echo 'verifySign:', $params['verifySign'];
echo "\n";
$ch = curl_init($url);
curl_setopt_array($ch, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($params),
));
$result = curl_exec($ch);
curl_exec($ch);
echo $result;
echo "\n";
return json_decode($result, true);
}
transCancel();
?>
public static void transactionCancel(String transactionNo) {
String url = DOMAIN_URL + TRANSACTION_CANCEL;
Map<String, Object> params = new TreeMap<String, Object>();
params.put("merchantNo", MERCHANT_NO);
params.put("storeNo", STORE_NO);
if (StringUtils.isNotEmpty(STORE_ADMIN_NO)) {
params.put("storeAdminNo", STORE_ADMIN_NO);
}
params.put("transactionNo", transactionNo);
String verifySign = verifySignHelper.getYuansferVerifySign(params, YUANSFER_TOKEN);
params.put("verifySign", verifySign);
String ret = HttpClientUtils.post(url, null, params);
System.out.println("---transaction reverse----");
System.out.println(ret);
}
复制链接