Yuansfer DOCS
Search…
Cancel
post
https://mapi.yuansfer.com/app-data-search/v3
/cancel
Cancel
Response
Parameter
Type
Description
result
object
The result of the refund.
ret_msg
string
The response return message.
ret_code
string
The response return code. For more details, see here.

Result Object

Parameter
Type
Description
amount
number
The transaction amount.
currency
string
The supported transaction currency "USD" "CNY".
reference
string
The Invoice Number of the transaction in the merchant's system.
status
string
The status of the refund.
transactionNo
string
The Transaction ID in the Yuansfer system.
cURL
PHP
Java
Go
1
curl -XPOST -H "Content-type: application/json" -d '{
2
"merchantNo": "200043",
3
"storeNo": "300014",
4
"verifySign": "dd81f7781603bec48ae2c6a9ac758bf2",
5
"transactionNo": "297553638301777927",
6
}' 'https://mapi.yuansfer.com/app-data-search/v3/cancel'
Copied!
1
<?php
2
function transCancel()
3
{
4
$url = 'https://mapi.yuansfer.yunkeguan.com/app-data-search/v3/cancel';
5
$token = '59600f2a9ad644c6a9570233560cc94e';
6
$params = [
7
'merchantNo' => '200043',
8
'storeNo' => '300014',
9
'transactionNo' => '297553565108438359'
10
];
11
ksort($params, SORT_STRING);
12
$str = '';
13
foreach ($params as $k => $v) {
14
$str .= $k . '=' . $v . '&';
15
}
16
$params['verifySign'] = md5($str . md5($token));
17
echo 'verifySign:', $params['verifySign'];
18
echo "\n";
19
$ch = curl_init($url);
20
curl_setopt_array($ch, array(
21
CURLOPT_RETURNTRANSFER => true,
22
CURLOPT_HEADER => false,
23
CURLOPT_POST => true,
24
CURLOPT_POSTFIELDS => http_build_query($params),
25
));
26
$result = curl_exec($ch);
27
curl_exec($ch);
28
echo $result;
29
echo "\n";
30
return json_decode($result, true);
31
}
32
transCancel();
33
?>
Copied!
1
public static void transactionCancel(String transactionNo) {
2
String url = DOMAIN_URL + TRANSACTION_CANCEL;
3
Map<String, Object> params = new TreeMap<String, Object>();
4
params.put("merchantNo", MERCHANT_NO);
5
params.put("storeNo", STORE_NO);
6
if (StringUtils.isNotEmpty(STORE_ADMIN_NO)) {
7
params.put("storeAdminNo", STORE_ADMIN_NO);
8
}
9
10
params.put("transactionNo", transactionNo);
11
String verifySign = verifySignHelper.getYuansferVerifySign(params, YUANSFER_TOKEN);
12
params.put("verifySign", verifySign);
13
String ret = HttpClientUtils.post(url, null, params);
14
System.out.println("---transaction reverse----");
15
System.out.println(ret);
16
}
Copied!
1
Copied!
Last modified 1mo ago
Copy link