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. Transaction Data Search

Transaction Query

TranQuery

POST https://mapi.yuansfer.com/app-data-search/v3/tran-query

This API gets the transaction details by ID of a transaction in the merchant's system.

Request Body

Name
Type
Description

merchantNo*

string

Merchant ID

storeNo*

string

Store ID

transactionNo

string

The Transaction ID in the Yuansfer system.

reference

string

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

verifySign*

string

The parameter signature.

{
    "result": {
        "amount": "10.00",
        "currency": "CNY",
        "reference": "test202001011305",
        "settleCurrency": "USD",
        "status": "success",
        "transactionNo": "297553638300708562",
        "transactionType": "payment"
    },
    "ret_code": "000100",
    "ret_msg": "query 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

transactionNo

string

The Transaction ID in the Yuansfer system.

reference

string

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

amount

number

The transaction amount.

status

string

The status of the transaction.

currency

string

The supported transaction currency is "USD", "CNY".

settleCurrency

string

The supported settlement currency is "USD", "CNY".

transactionType

string

The type will be either "payment" or "refund".

RefundInfo Object

Parameter

Type

Description

refundTransactionId

string

The ID of the refund transaction in the Yuansfer system.

refundReference

string

The ID of the refund transaction in the merchant’s system.

refundAmount

string

The transaction refund amount. This parameter will be returned only when the payment order contains a 'Amount'.

refundRmbAmount

string

The transaction refund amount of CNY. This parameter will be returned only when the payment order contains a 'rmbAmount'.

currency

string

The supported transaction currency is "USD", "CNY".

settleCurrency

string

The supported settlement currency is "USD", "CNY".

curl -XPOST -H "Content-type: application/json" -d '{
    "merchantNo": "200043",
    "storeNo": "300014",
    "transactionNo": "297553638300708562",
    "verifySign": "0df745088d7202a6d186596acdc82c6a"
}' 'https://mapi.yuansfer.com/app-data-search/v3/tran-query'
 <?php
    function securepayReferenceQuery()
    {
        $url = 'https://mapi.yuansfer.com/app-data-search/v3/tran-query';
        $token = '5cbfb079f15b150122261c8537086d77a';
        $params = [
            'merchantNo' => '200043',
            'storeNo' => '300014',
            'reference' => 'test2018070101'
        ];
        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);
    }
    securepayReferenceQuery();
?>
public class SecurepayReferenceQueryTest {
    public static final String TEST_URL = "https://mapi.yuansfer.yunkeguan.com";            //Testing domain
    public static final String PROD_URL = "https://mapi.yuansfer.com";                      //Production domain
    public static final String YUANSFER_TOKEN = "5cbfb079f15b150122261c8537086d77a";

    public static void main(String[] args) {
        YuansferVerifySignHelper helper = new YuansferVerifySignHelper();

        YuansferSecurepayQueryDto dto = paramSetting();
        Map<String, Object> params = ReflectionUtils.convertBean2MapIgnoreNullVal(dto, new String[]{"serialVersionUID"});
        String verifySign = helper.getYuansferVerifySign(params, YUANSFER_TOKEN);  //verifySign
        params.put("verifySign", verifySign);

        String url = TEST_URL + "/app-data-search/v3/tran-query";
        String ret = HttpClientUtils.post(url, null, params);
        System.out.println(ret);
    }

    public static YuansferSecurepayQueryDto paramSetting() {
        YuansferSecurepayQueryDto dto = new YuansferSecurepayQueryDto();

        dto.setMerchantNo("200043");                                                //The merchant NO.
        dto.setStoreNo("300014");                                                   //The store NO.
        dto.setReference("20180126162433");
        return dto;
    }
}
func query(t *table) {
    req := yuan.Query{
        MerchantNo: "200043", //customer The merchant NO.
        StoreNo:    "300014",
        Reference:  "original sequence No.", //sequence number of customer system
    }

    //TO CALL VERIFYSIGN
    resp, err := req.PostToYuansfer(yuansferToken)
    if err != nil {
        fmt.Println(err)
        return
    }
    fmt.Println(resp)
}

PreviousTransaction Data SearchNextPayouts

Last updated 2 years ago

Was this helpful?

The response return code. For more details, see .

here