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
  4. Scan QR Code

Prepay

Prepay

POST https://mapi.yuansfer.com/app-instore/v3/prepay

Request Body

Name
Type
Description

merchantNo*

string

Merchant ID

storeNo*

string

Store ID

storeAdminNo

string

Store Admin ID

transactionNo

string

The Invoice Number of the transaction in Yuansfer's system. Either transactionNo or reference is required.

reference

string

The Invoice Number of the transaction in the merchant's system. Either transactionNo or reference is required.

paymentBarcode*

string

The payment method. The payment barcode from the customer.

verifySign*

string

The parameter signature.

{
    "result": {
        "amount": "13.00",
        "createTime": "2020-10-12 21:38:16",
        "currency": "USD",
        "merchantNo": "200043",
        "originalTransactionNo": null,
        "paymentTime": "2020-10-12 22:38:16",
        "reference": "test20200101206",
        "refundAmount": "0.00",
        "settleCurrency": "USD",
        "storeAdminNo": null,
        "storeNo": "300014",
        "transactionNo": "297553638241892410",
        "transactionStatus": "success",
        "transactionType": "payment",
        "voidAmount": "0.00"
    },
    "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

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 -XPOST -H "Content-type: application/json" -d '{
    "merchantNo": "200043",
    "storeNo": "300014",
    "verifySign": "f38965887c5676e2fb19d951251eb613",
    "transactionNo": "297553636764407286",
    "paymentBarcode": "286498530672949108",
    "vendor": "alipay"
}' 'https://mapi.yuansfer.com/app-instore/v3/pay'
 <?php
    function transPay()
    {
        $url = 'https://mapi.yuansfer.yunkeguan.com/app-data-search/v3/pay';
        $token = '59600f2a9ad644c6a9570233560cc94e';
        $params = [
            'merchantNo' => '200043',
            'storeNo' => '300014',
            'transactionNo' => '297553565108438359',
            'vendor' => 'alipay',
            'amount' => '0.01',
            'paymentBarcode' => '280526696410694666'
        ];
        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);
    }
    transPay();
?>
public static void transactionPay(String transactionNo) {
    String url = DOMAIN_URL + TRANSACTION_PAY;
    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("transactionNo", transactionNo);
    params.put("paymentBarcode", "286754322648217439");
    params.put("vendor", "alipay");
    String verifySign = verifySignHelper.getYuansferVerifySign(params, YUANSFER_TOKEN);
    params.put("verifySign", verifySign);
    String ret = HttpClientUtils.post(url, null, params);
    System.out.println("---transaction pay----");
    System.out.println(ret);
}
PreviousAddNextCreate QR Code

Last updated 2 years ago

Was this helpful?

The response return code. For more details, see .

here