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

Signing API Parameters

Signing the API parameters is a feature that allows you to secure your Yuansfer API calls, by using MD5 encryption and authenticated hash.

You will need to retrieve your API token from the Yuansfer Dashboard in order to build the parameters of your API calls. API parameters must be signed with MD5 encryption.

Building the API parameter signature

To sign the API parameters, you need to follow these steps:

  1. Sort the parameters alphabetically according to the parameter name.

  2. Concatenate the parameter names and values using '=' and '&' character.

  3. Append the MD5 hash value of your API token to the end of your parameters with the '&' prefix.

  4. Calculate the MD5 hash value of the Step 3 result.

EXAMPLE

Consider the following parameters:

  • amount = '1.00'

  • storeNo = '300014'

  • currency = 'USD'

  • merchantNo = '200043'

  • callbackUrl = 'https://wx.yuansfer.yunkeguan.com/wx'

  • terminal = 'ONLINE'

  • ipnUrl = 'https://wx.yuansfer.yunkeguan.com/wx'

  • reference = 'seq_1525922323'

  • vendor = 'alipay'

  • goodsInfo = '[{"goods_name":"Yuansfer","quantity":"1"}]'

  • timeout = '120'

1. Sort the parameters alphabetically

  • amount = '1.00'

  • callbackUrl = 'https://wx.yuansfer.yunkeguan.com/wx'

  • currency = 'USD'

  • goodsInfo = '[{"goods_name":"Yuansfer","quantity":"1"}]'

  • ipnUrl = 'https://wx.yuansfer.yunkeguan.com/wx'

  • merchantNo = '200043'

  • reference = 'seq_1525922323'

  • storeNo = '300014'

  • terminal = 'ONLINE'

  • timeout = '120'

  • vendor = 'alipay'

2. Concatenate the parameter names and values using '=' and '&' character

amount=1.00&callbackUrl=https://wx.yuansfer.yunkeguan.com/wx& currency=USD&goodsInfo=[{"goods_name":"Yuansfer","quantity":"1"}]&ipnUrl=https://wx.yuansfer.yunkeguan.com/wx&merchantNo=200043&reference=seq_1525922323&storeNo=300014&terminal=ONLINE&timeout=120&vendor=alipay

3. Append MD5 hash value of API token with '&' prefix.

When the API token is 5cbfb079f15b150122261c8537086d77a, the MD5 hash value is 186abea4b8610d7ff03768255588597a.

So the result string is :

amount=1.00&callbackUrl=https://wx.yuansfer.yunkeguan.com/wx& currency=USD&goodsInfo=[{"goods_name":"Yuansfer","quantity":"1"}]&ipnUrl=https://wx.yuansfer.yunkeguan.com/wx&merchantNo=200043&reference=seq_1525922323&storeNo=300014&terminal=ONLINE&timeout=120&vendor=alipay&186abea4b8610d7ff03768255588597a

4. Calculate the MD5 hash value of Step 3 result string.

MD5 hash value is b6bfd66531ae7c9499115c7480a2c8aa

PreviousSandbox EnvironmentNextCustomers

Last updated 4 years ago

Was this helpful?