Yuansfer DOCS
Search…
Refund
post
https://mapi.yuansfer.com/app-data-search/v3
/refund
Refund
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.
refundAmount
number
The transaction refund amount. This parameter will be returned only when the payment order contains a 'Amount'.
currency
string
The supported transaction currencies are "USD" "CNY".
settleCurrency
string
The supported settlement currencies are "USD".
status
string
The status of the refund.
reference
string
The Invoice Number of the transaction in the merchant’s system.
refundReference
string
The ID of the refund transaction in the merchant’s system.
refundTransactionNo
string
The ID of the refund transaction in the Yuansfer system.
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
"refundAmount": "0.01",
6
"currency": "USD",
7
"settleCurrency": "USD",
8
"transactionNo": "297553638301777927",
9
"refundReference": "refund2020101305"
10
}' 'https://mapi.yuansfer.com/app-data-search/v3/refund'
Copied!
1
<?php
2
function securepayRefund()
3
{
4
$url = 'https://mapi.yuansfer.com/app-data-search/v3/refund';
5
$token = '5cbfb079f15b150122261c8537086d77a';
6
$params = [
7
'merchantNo' => '200043',
8
'storeNo' => '300014',
9
'amount' => '0.01',
10
'reference' => 'test2018070101'];
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
securepayRefund();
33
?>
Copied!
1
public class SecurepayRefundTest {
2
public static final String TEST_URL = "https://mapi.yuansfer.yunkeguan.com"; //Testing domain
3
public static final String PROD_URL = "https://mapi.yuansfer.com"; //Production domain
4
public static final String YUANSFER_TOKEN = "5c5fe30183be69fceff8174358d4b8ae";
5
6
public static void main(String[] args) {
7
YuansferSecurepayRefundDto refundDto = new YuansferSecurepayRefundDto();
8
YuansferVerifySignHelper verifyHelper = new YuansferVerifySignHelper();
9
refundDto.setAmount("0.01");
10
refundDto.setCurrency("USD");
11
refundDto.setSettleCurrency("USD");
12
refundDto.setMerchantNo("200043");
13
refundDto.setStoreNo("300014");
14
refundDto.setReference("9091023122");
15
16
17
Map<String, Object> params = ReflectionUtils.convertBean2MapIgnoreNullVal(refundDto, new String[]{"serialVersionUID"});
18
String verifySign = verifyHelper.getYuansferVerifySign(params, YUANSFER_TOKEN);
19
refundDto.setVerifySign(verifySign);
20
params.put("verifySign", verifySign);
21
22
String url = TEST_URL + "/app-data-search/v3/refund";
23
String ret = HttpClientUtils.post(url, null, params);
24
JSON json = JSON.parseObject(ret);
25
System.out.println(json);
26
}
27
}
Copied!
1
func refund(t *table) {
2
req := yuan.Refund{
3
MerchantNo: "200043", //customer The merchant NO.
4
StoreNo: "300014",
5
Currency: "USD",
6
SettleCurrency: "USD",
7
Reference: "original sequence No.", //sequence number of customer system
8
Amount: "0.01",
9
}
10
11
resp, err := req.PostToYuansfer(yuansferToken)
12
if err != nil {
13
fmt.Println(err)
14
return
15
}
16
fmt.Println(resp)
17
}
Copied!
Last modified 1mo ago
Copy link