Yuansfer DOCS
Search…
Prepay
post
https://mapi.yuansfer.com/app-instore/v3
/prepay
Prepay
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
string
The transaction amount.
createTime
string
The date and time when the transaction was created.
Format : "yyyy-MM-dd HH:mm:ss".
currency
string
The three-character currency code that identifies the 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
This is the currency that a payment will be made to the merchant.
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 transaction type.
The possible values are: "payment","refund","void".
voidAmount
number
The void or cancel amount.
cURL
PHP
Java
Go
1
curl -XPOST -H "Content-type: application/json" -d '{
2
"merchantNo": "200043",
3
"storeNo": "300014",
4
"verifySign": "f38965887c5676e2fb19d951251eb613",
5
"transactionNo": "297553636764407286",
6
"paymentBarcode": "286498530672949108",
7
"vendor": "alipay"
8
}' 'https://mapi.yuansfer.com/app-instore/v3/pay'
Copied!
1
<?php
2
function transPay()
3
{
4
$url = 'https://mapi.yuansfer.yunkeguan.com/app-data-search/v3/pay';
5
$token = '59600f2a9ad644c6a9570233560cc94e';
6
$params = [
7
'merchantNo' => '200043',
8
'storeNo' => '300014',
9
'transactionNo' => '297553565108438359',
10
'vendor' => 'alipay',
11
'amount' => '0.01',
12
'paymentBarcode' => '280526696410694666'
13
];
14
ksort($params, SORT_STRING);
15
$str = '';
16
foreach ($params as $k => $v) {
17
$str .= $k . '=' . $v . '&';
18
}
19
$params['verifySign'] = md5($str . md5($token));
20
echo 'verifySign:', $params['verifySign'];
21
echo "\n";
22
$ch = curl_init($url);
23
curl_setopt_array($ch, array(
24
CURLOPT_RETURNTRANSFER => true,
25
CURLOPT_HEADER => false,
26
CURLOPT_POST => true,
27
CURLOPT_POSTFIELDS => http_build_query($params),
28
));
29
$result = curl_exec($ch);
30
curl_exec($ch);
31
echo $result;
32
echo "\n";
33
return json_decode($result, true);
34
}
35
transPay();
36
?>
Copied!
1
public static void transactionPay(String transactionNo) {
2
String url = DOMAIN_URL + TRANSACTION_PAY;
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
params.put("paymentBarcode", "286754322648217439");
12
params.put("vendor", "alipay");
13
String verifySign = verifySignHelper.getYuansferVerifySign(params, YUANSFER_TOKEN);
14
params.put("verifySign", verifySign);
15
String ret = HttpClientUtils.post(url, null, params);
16
System.out.println("---transaction pay----");
17
System.out.println(ret);
18
}
Copied!
1
Copied!
Last modified 26d ago
Copy link