Yuansfer DOCS
Search…
Add
post
https://mapi.yuansfer.com/app-instore/v3
/add
Add
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
amount
number
The transaction amount.
createTime
string
The date and time when the transaction was created.
Format : "yyyy-MM-dd HH:mm:ss".
currency
string
The supported transaction currency is "USD".
merchantNo
string
Merchant ID
originalTransactionNo
string
The ID of the original transaction in the Yuansfer system.
paymentTime
string
The date and time when the payment was processed.
Format : "yyyy-MM-dd HH:mm:ss".
reference
string
The Invoice Number of the transaction in the merchant’s system.
refundAmount
number
The refund amount.
settleCurrency
string
The supported settlement currency "USD".
storeAdminNo
string
Store Admin ID
storeNo
string
Store ID
transactionNo
string
The Transaction ID in the Yuansfer system.
transactionStatus
string
The status of the transaction.
transactionType
string
The possible transaction type values are "payment", "refund", "void".
voidAmount
number
The void or cancel amount.
cURL
PHP
Java
Go
1
curl -XPOST -d '{
2
"merchantNo": "200043",
3
"storeNo": "300014",
4
"verifySign": "c29c8240bf99510d4d53a0ca36f9c135",
5
"amount": "13",
6
"currency": "USD",
7
"settleCurrency": "USD",
8
"reference": "test202001011206"
9
}' 'https://mapi.yuansfer.com/app-instore/v3/add'
Copied!
1
<?php
2
function transAdd()
3
{
4
$url = 'https://mapi.yuansfer.yunkeguan.com/app-data-search/v3/add';
5
$token = '59600f2a9ad644c6a9570233560cc94e';
6
$params = [
7
'merchantNo' => '200043',
8
'storeNo' => '300014',
9
'vendor' => 'alipay',
10
'amount' => '0.01'
11
];
12
ksort($params, SORT_STRING);
13
$str = '';
14
foreach ($params as $k => $v) {
15
$str .= $k . '=' . $v . '&';
16
}
17
$params['verifySign'] = md5($str . md5($token));
18
echo 'verifySign:', $params['verifySign'];
19
echo "\n";
20
$ch = curl_init($url);
21
curl_setopt_array($ch, array(
22
CURLOPT_RETURNTRANSFER => true,
23
CURLOPT_HEADER => false,
24
CURLOPT_POST => true,
25
CURLOPT_POSTFIELDS => http_build_query($params),
26
));
27
$result = curl_exec($ch);
28
curl_exec($ch);
29
echo $result;
30
echo "\n";
31
return json_decode($result, true);
32
}
33
transAdd();
34
?>
Copied!
1
public static String transactionAdd() {
2
String url = DOMAIN_URL + TRANSACTION_ADD;
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("amount", "0.01");
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 add----");
15
System.out.println(ret);
16
JSONObject retInfo = (JSONObject)JSONValue.parse(ret);
17
JSONObject transaction = (JSONObject)retInfo.get("transaction");
18
String transactionNo = transaction.get("transactionNo").toString();
19
return transactionNo;
20
}
Copied!
1
Copied!
Last modified 1mo ago
Copy link