Yuansfer DOCS
  • Introduction
  • GUIDE
    • Online Payment
    • Point of Sale
      • Scan QR Code
      • Create QR Code
    • Plugins
    • Payment Methods
    • Financial Report
    • Security
    • Incident Priorities
    • SDK
    • Tutorials & Examples
      • PHP SDK
      • JAVA SDK
      • C# SDK
      • JS SDK
  • API REFERENCE V3
    • Sandbox Environment
      • Apply Sandbox Credentials
    • Signing API Parameters
    • Customers
      • Register Customer
      • Retrieve Customer
      • Update Customer
    • Payments
      • Online Payment
        • Yuansfer Checkout
        • Yuansfer Integrated Payment
          • Braintree Payments
          • Prepay
        • Recurring Payments
          • Authorize
          • Apply Token
          • Pay
          • Revoke
      • Point of Sale Payment
        • Scan QR Code
          • Add
          • Prepay
        • Create QR Code
    • Transaction Revert
      • Refund
      • Cancel
    • Transaction Data Search
      • Transaction Query
    • Payouts
      • Create Payee
      • Retrieve Payee
      • Balance
      • Send Money
      • Search Payments
    • Notes
  • 中文
Powered by GitBook
On this page

Was this helpful?

  1. API REFERENCE V3
  2. Payments
  3. Point of Sale Payment

Create QR Code

Referred to as create-trans-qrcode

PreviousPrepayNextTransaction Revert

Last updated 2 years ago

Was this helpful?

This API is used in Merchant-Presented use cases. To learn more please see the .

CreateTransQrcode

POST https://mapi.yuansfer.com/app-instore/v3/create-trans-qrcode

This API creates a transaction and get a QR code for customers to scan to pay in the Transaction QR Code Payment process. Customers scan this QR code using the wallet app to checkout.

Request Body

Name
Type
Description

merchantNo*

string

Merchant ID

storeNo*

string

Store ID

storeAdminNo

string

Store Admin ID

amount*

string

The transaction amount.

currency*

string

The supported transaction currency are "USD".

settleCurrency*

string

The supported settlement currency are "USD".

vendor*

string

The possible payment channels are "alipay", "wechatpay", "cashapppay". ("unionpay" not supported yet)

reference*

string

The Invoice Number of the transaction in the merchant's system.

ipnUrl*

string

The Instant Payment Notification Handler URL. IPN URL must be secure.

needQrcode*

string

The possible values are: true or false. The default value is false. If this parameter is true, the Yuansfer system will create the QR Code image. If this parameter is false, the Yuansfer system will not create a QR Code image.

timeout

integer

The timeout in minutes, default value is 120.

verifySign*

string

The parameter signature.

{
    "result": {
        "reference": "test2020102023",
        "amount": "0.11",
        "deepLink": "https://qr.alipay.com/bax05773sia4dshxhw7100f3",
        "transactionNo": "297553638914321581",
        "settleCurrency": "USD",
        "currency": "USD",
        "timeout": "120",
        "qrcodeUrl": "https://mobilecodec.alipaydev.com/show.htm?code=bax05773sia4dshxhw7100f3&picSize=M"
    },
    "ret_code": "000100",
    "ret_msg": "add success"
}

Response

Parameter

Type

Description

result

object

The result object.

ret_msg

string

The response return message.

ret_code

string

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 -XPOST -H "Content-type: application/json" -d '{
    "merchantNo": "200043",
    "storeNo": "300014",
    "verifySign": "45bfac0286debaf0c316c011d6842d2c",
    "amount": "0.11",
    "currency": "USD",
    "settleCurrency": "USD",
    "needQrcode" "true",
    "reference": "test2020102023",
    "ipnUrl": "http://zk-tys.yunkeguan.com/login/test",
    "needQrcode": "true",
    "vendor": "alipay",
    "timeout": "120"
}' 'https://mapi.yuansfer.com/app-instore/v3/create-trans-qrcode'
 <?php
    function transQrcode()
    {
        $url = 'https://mapi.yuansfer.yunkeguan.com/app-data-search/v3/create-trans-qrcode';
        $token = '59600f2a9ad644c6a9570233560cc94e';
        $params = [
            'merchantNo' => '200043',
            'storeNo' => '300014',
            'vendor' => 'alipay',
            'amount' => '0.01',
            'needQrcode' => 'true',
            'ipnUrl' => 'https://nengjtian.s1.natapp.cc/login/test',
            'reference' => 'test2018061901',
        ];
        ksort($params, SORT_STRING);
        $str = '';
        foreach ($params as $k => $v) {
            $str .= $k . '=' . $v . '&';
        }
        $params['verifySign'] = md5($str . md5($token));
        echo 'verifySign:', $params['verifySign'];
        echo "\n";
        $ch = curl_init($url);
        curl_setopt_array($ch, array(
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_HEADER => false,
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => http_build_query($params),
        ));
        $result = curl_exec($ch);
        curl_exec($ch);
        echo $result;
        echo "\n";
        return json_decode($result, true);
    }
    transQrcode();
?>
public static void transQrcode() {
    String url = DOMAIN_URL + TRANS_QRCODE;
    Map<String, Object> params = new TreeMap<String, Object>();
    params.put("merchantNo", MERCHANT_NO);
    params.put("storeNo", STORE_NO);
    if (StringUtils.isNotEmpty(STORE_ADMIN_NO)) {
        params.put("storeAdminNo", STORE_ADMIN_NO);
    }

    params.put("vendor", "alipay");
    params.put("amount", "0.01");
    params.put("needQrcode", "true");
    params.put("ipnUrl", "https://nengjtian.s1.natapp.cc/login/test");
    params.put("reference", "testabc100");
    String verifySign = verifySignHelper.getYuansferVerifySign(params, YUANSFER_TOKEN);
    params.put("verifySign", verifySign);
    String ret = HttpClientUtils.post(url, null, params);
    System.out.println("---trans-qrcode-create ----");
    System.out.println(ret);
}

The response return code. For more details, see .

guide
here