Yuansfer DOCS
Search…
Create QR Code
Referred to as create-trans-qrcode
This API is used in Merchant-Presented use cases. To learn more please see the guide.
post
https://mapi.yuansfer.com/app-instore/v3
/create-trans-qrcode
CreateTransQrcode
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
reference
string
The Transaction ID in the Yuansfer system.
amount
number
The transaction amount in USD.
deepLink
string
The deep link URL. (the non-homepage URL).
transactionNo
string
The Invoice Number of the transaction in the Merchant's system.
settleCurrency
string
The supported settlement currency are "USD".
currency
string
The supported transaction currency are "USD".
timeout
integer
The timeout in minutes, default value is 120.
qrcodeUrl
string
The URL of the transaction QR code.
cURL
PHP
Java
Go
1
curl -XPOST -H "Content-type: application/json" -d '{
2
"merchantNo": "200043",
3
"storeNo": "300014",
4
"verifySign": "45bfac0286debaf0c316c011d6842d2c",
5
"amount": "0.11",
6
"currency": "USD",
7
"settleCurrency": "USD",
8
"needQrcode" "true",
9
"reference": "test2020102023",
10
"ipnUrl": "http://zk-tys.yunkeguan.com/login/test",
11
"needQrcode": "true",
12
"vendor": "alipay",
13
"timeout": "120"
14
}' 'https://mapi.yuansfer.com/app-instore/v3/create-trans-qrcode'
Copied!
1
<?php
2
function transQrcode()
3
{
4
$url = 'https://mapi.yuansfer.yunkeguan.com/app-data-search/v3/create-trans-qrcode';
5
$token = '59600f2a9ad644c6a9570233560cc94e';
6
$params = [
7
'merchantNo' => '200043',
8
'storeNo' => '300014',
9
'vendor' => 'alipay',
10
'amount' => '0.01',
11
'needQrcode' => 'true',
12
'ipnUrl' => 'https://nengjtian.s1.natapp.cc/login/test',
13
'reference' => 'test2018061901',
14
];
15
ksort($params, SORT_STRING);
16
$str = '';
17
foreach ($params as $k => $v) {
18
$str .= $k . '=' . $v . '&';
19
}
20
$params['verifySign'] = md5($str . md5($token));
21
echo 'verifySign:', $params['verifySign'];
22
echo "\n";
23
$ch = curl_init($url);
24
curl_setopt_array($ch, array(
25
CURLOPT_RETURNTRANSFER => true,
26
CURLOPT_HEADER => false,
27
CURLOPT_POST => true,
28
CURLOPT_POSTFIELDS => http_build_query($params),
29
));
30
$result = curl_exec($ch);
31
curl_exec($ch);
32
echo $result;
33
echo "\n";
34
return json_decode($result, true);
35
}
36
transQrcode();
37
?>
Copied!
1
public static void transQrcode() {
2
String url = DOMAIN_URL + TRANS_QRCODE;
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("vendor", "alipay");
11
params.put("amount", "0.01");
12
params.put("needQrcode", "true");
13
params.put("ipnUrl", "https://nengjtian.s1.natapp.cc/login/test");
14
params.put("reference", "testabc100");
15
String verifySign = verifySignHelper.getYuansferVerifySign(params, YUANSFER_TOKEN);
16
params.put("verifySign", verifySign);
17
String ret = HttpClientUtils.post(url, null, params);
18
System.out.println("---trans-qrcode-create ----");
19
System.out.println(ret);
20
}
Copied!
1
Copied!
Last modified 1mo ago
Copy link