Yuansfer DOCS
Search…
Transaction Query
post
https://mapi.yuansfer.com/app-data-search/v3
/tran-query
TranQuery
Response
Parameter
Type
Description
result
object
The result object.
ret_msg
string
The response return message.
ret_code
string
The response return code. For more details, see here.
Result Object
Parameter
Type
Description
transactionNo
string
The Transaction ID in the Yuansfer system.
reference
string
The Invoice Number of the transaction in the merchant’s system.
amount
number
The transaction amount.
status
string
The status of the transaction.
currency
string
The supported transaction currency is "USD", "CNY".
settleCurrency
string
The supported settlement currency is "USD", "CNY".
transactionType
string
The type will be either "payment" or "refund".
RefundInfo Object
Parameter
Type
Description
refundTransactionId
string
The ID of the refund transaction in the Yuansfer system.
refundReference
string
The ID of the refund transaction in the merchant’s system.
refundAmount
string
The transaction refund amount. This parameter will be returned only when the payment order contains a 'Amount'.
refundRmbAmount
string
The transaction refund amount of CNY. This parameter will be returned only when the payment order contains a 'rmbAmount'.
currency
string
The supported transaction currency is "USD", "CNY".
settleCurrency
string
The supported settlement currency is "USD", "CNY".
cURL
PHP
Java
Go
1
curl -XPOST -H "Content-type: application/json" -d '{
2
"merchantNo": "200043",
3
"storeNo": "300014",
4
"transactionNo": "297553638300708562",
5
"verifySign": "0df745088d7202a6d186596acdc82c6a"
6
}' 'https://mapi.yuansfer.com/app-data-search/v3/tran-query'
Copied!
1
<?php
2
function securepayReferenceQuery()
3
{
4
$url = 'https://mapi.yuansfer.com/app-data-search/v3/tran-query';
5
$token = '5cbfb079f15b150122261c8537086d77a';
6
$params = [
7
'merchantNo' => '200043',
8
'storeNo' => '300014',
9
'reference' => 'test2018070101'
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
securepayReferenceQuery();
33
?>
Copied!
1
public class SecurepayReferenceQueryTest {
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 = "5cbfb079f15b150122261c8537086d77a";
5
6
public static void main(String[] args) {
7
YuansferVerifySignHelper helper = new YuansferVerifySignHelper();
8
9
YuansferSecurepayQueryDto dto = paramSetting();
10
Map<String, Object> params = ReflectionUtils.convertBean2MapIgnoreNullVal(dto, new String[]{"serialVersionUID"});
11
String verifySign = helper.getYuansferVerifySign(params, YUANSFER_TOKEN); //verifySign
12
params.put("verifySign", verifySign);
13
14
String url = TEST_URL + "/app-data-search/v3/tran-query";
15
String ret = HttpClientUtils.post(url, null, params);
16
System.out.println(ret);
17
}
18
19
public static YuansferSecurepayQueryDto paramSetting() {
20
YuansferSecurepayQueryDto dto = new YuansferSecurepayQueryDto();
21
22
dto.setMerchantNo("200043"); //The merchant NO.
23
dto.setStoreNo("300014"); //The store NO.
24
dto.setReference("20180126162433");
25
return dto;
26
}
27
}
Copied!
1
func query(t *table) {
2
req := yuan.Query{
3
MerchantNo: "200043", //customer The merchant NO.
4
StoreNo: "300014",
5
Reference: "original sequence No.", //sequence number of customer system
6
}
7
8
//TO CALL VERIFYSIGN
9
resp, err := req.PostToYuansfer(yuansferToken)
10
if err != nil {
11
fmt.Println(err)
12
return
13
}
14
fmt.Println(resp)
15
}
Copied!
Last modified 1mo ago
Copy link