{"info":{"_postman_id":"7d3722ae-7ae5-43b6-8741-7a9442a47fef","name":"Motion Pay POS API","description":"<html><head></head><body><h1 id=\"chapter-1-introduction\">Chapter 1: Introduction</h1>\n<h2 id=\"11-purpose\">1.1 Purpose</h2>\n<p>This document is the official manual for MotionPay`s payment APIs. It is the tutorial for technical architects, R&amp;D engineers, testing engineers and service engineers for the integrated WeChatPay and Alipay system, which includes vendors' systems such as online shopping platforms, cashier systems, or POS systems.</p>\n<h2 id=\"12-audience\">1.2 Audience</h2>\n<ul>\n<li>Software developers for mobile payment platform</li>\n<li>Third party interface</li>\n</ul>\n<h2 id=\"13-terms\">1.3 Terms</h2>\n<h3 id=\"131-merchant-scan-customer-mobile\">1.3.1 Merchant Scan Customer Mobile</h3>\n<p>The Customer shows their barcode/QR Code on WeChat's or Alipay app to the Vendor to scan in order to pay directly. This mode applies to in-store payment scenarios.</p>\n<h3 id=\"132-customer-mobile-scan-merchant\">1.3.2 Customer Mobile Scan Merchant</h3>\n<p>The Merchant generates a transaction QR Code according to the MotionPay Protocol on their POS terminal and the Customer scan QR Code from their app in order to complete the payment. This mode is applicable to payments made on websites, physical stores, media advertising, or other scenarios.</p>\n<h1 id=\"chapter-2-interface-specification\">Chapter 2: Interface Specification</h1>\n<ul>\n<li><p>Please use HTTP 'POST' method to access the URL, both the request data and response data are in JSON format</p>\n</li>\n<li><p>All data encoding is using 'UTF-8'</p>\n</li>\n<li><p>This is the API URL format. The '{actionPath}' is the function name. For example 'pay/order'. http[s]://host/payment/{actionPath}</p>\n</li>\n<li><p><strong>The Test API URL : <a href=\"https://api.motionpay.org/payment/%7BactionPath%7D\">https://api.motionpay.org/payment/{actionPath}</a></strong></p>\n</li>\n<li><p><strong>The test merchant ID : 100122220000005</strong></p>\n</li>\n<li><p><strong>The test App ID : 5005642019001</strong></p>\n</li>\n<li><p><strong>The test App Secure : ae26b1841a7291379db606e41bfa4417</strong></p>\n</li>\n</ul>\n<h2 id=\"21-data-encryption\">2.1 Data encryption</h2>\n<ul>\n<li>The data is encrypted by SHA1 signature. The {appid} and {appsecret} is provided by MotionPay</li>\n<li>The signature is generated by the following steps:</li>\n</ul>\n<p>Put all the data in the 'param' into a set M. Remove the parameters which have empty/null value. Order the <strong>param</strong> set M by the parameter names using 'ASCII' code (increasing). Put all the parameters (names and values) into a string A in this format (\"key1=value1&amp;key2=value2…\"). It is the same format as the HTTP get method.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>- Only the data in 'param' needs to be there\n- Order by parameter names by ASCII code increasing\n- Parameters which have Empty or Null value need to be removed\n- Parameter names and values are case sensitive\n</code></pre><p>Append 'appid={appid}&amp;appsecret={appsecret}' to the end of the StringA you get from step 1 to get stringSignTemp. Use SHA1 method to encrypt stringSignTemp. Then you will get the <strong>signValue</strong> for the sign parameter.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>- {appid} and {appsecret} are provided by MotionPay\n- signValue is the signature value for the sign parameter\n- signValue need to be in small case.\n</code></pre><p>Sample of stringSignTemp:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>amount=1&amp;amp;authcode=284773369684066898&amp;amp;merchantorderno=2018080974810084&amp;amp;paramjsonobject={&amp;quot;goods\\_info&amp;quot;:&amp;quot;Test\\_Product&amp;quot;,&amp;quot;spbill\\_create\\_ip&amp;quot;:&amp;quot;192.168.2.253&amp;quot;,&amp;quot;store\\_id&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;terminal\\_no&amp;quot;:&amp;quot;WP15461Q00001350&amp;quot;}&amp;amp;paychannel=U&amp;amp;appid=5005642017008&amp;amp;appsecret=cd3f5e88a1ec1df2351cdca75d7ce94a\n</code></pre><p>Sample of signValue generated by SHA1:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascripts\">85171774a62ce5806abd0f1417dcc059dbfbebb7\n</code></pre>\n<ul>\n<li>You can use some online tools to check the SHA1 result you generated:<blockquote>\n<p><a href=\"http://www.sha1-online.com/\">http://www.sha1-online.com/</a></p>\n</blockquote>\n</li>\n</ul>\n<h2 id=\"22-payment-amount\">2.2 Payment Amount</h2>\n<p>The currency type for transaction is CAD (Canadian Dollar) by default. The unit used in payment amount is 【cent】 and must be an integer. </p>\n<h2 id=\"23-merchant-order-number\">2.3 Merchant Order Number</h2>\n<p>The order number has to be generated manually, javascript example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">function pad2(n) { return n &lt; 10 ? '0' + n : n }\n\nvar date = new Date();\n\norderNo = date.getFullYear().toString() + pad2(date.getMonth() + 1) + pad2( date.getDate()) + pad2( date.getHours() ) + pad2( date.getMinutes() ) + pad2( date.getSeconds() ) ;\n\norderNo = orderNo.toString();\n\n// orderNo: 20190112151250\n</code></pre>\n<h2 id=\"23-auth-code\">2.3 Auth Code</h2>\n<p>Auth code is used in Merchant Scan Customer Mobile and displayed by a customer in Wechat or Alipay APP.</p>\n<h1 id=\"chapter-3-api-list\">Chapter 3: API List</h1>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Chapter 1: Introduction","slug":"chapter-1-introduction"},{"content":"Chapter 2: Interface Specification","slug":"chapter-2-interface-specification"},{"content":"Chapter 3: API List","slug":"chapter-3-api-list"}],"owner":"6368806","collectionId":"7d3722ae-7ae5-43b6-8741-7a9442a47fef","publishedId":"RztfvrCA","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-08-29T14:01:35.000Z"},"item":[{"name":"Merchant Scan Customer Mobile Order","event":[{"listen":"prerequest","script":{"id":"98b1b21d-0b48-4e27-93ef-cfebcb58f17a","exec":["authCode =  \"134721223841991573\"","","function pad2(n) { return n < 10 ? '0' + n : n }","","var date = new Date();","","orderNo = date.getFullYear().toString() + pad2(date.getMonth() + 1) + pad2( date.getDate()) + pad2( date.getHours() ) + pad2( date.getMinutes() ) + pad2( date.getSeconds() ) ;","","orderNo = orderNo.toString();","","console.log('no',orderNo);","","pra = {\"goods_info\":\"Test_Product\",\"spbill_create_ip\":\"192.168.2.253\",\"store_id\":\"\",\"terminal_no\":\"MyPosT00001\"};","console.log('pra',pra);","","requestBody =\"amount=1&authcode=\"+authCode+\"&merchantorderno=\"+orderNo+\"&paramjsonobject=\"+JSON.stringify(pra)+\"&paychannel=U&appid=5005642019001&appsecret=ae26b1841a7291379db606e41bfa4417\"","","","console.log('requestBody',requestBody);","","var signature = \"\";","","if(requestBody){","    // SHA1 hash","    signature = CryptoJS.SHA1(requestBody);","}","","postman.setGlobalVariable(\"signature\", signature);","postman.setGlobalVariable(\"orderNo\", orderNo);","postman.setGlobalVariable(\"authCode\", authCode);","","","console.log('signature',signature);","","",""],"type":"text/javascript"}}],"id":"46ac6552-cbbd-4c7c-8870-5a1540a79bbe","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"amount\": 1,\n        \"authCode\": \"{{authCode}}\",\n        \"merchantOrderNo\": \"{{orderNo}}\",\n        \"paramJsonObject\": {\n            \"goods_info\": \"Test_Product\",\n            \"spbill_create_ip\": \"192.168.2.253\",\n            \"store_id\": \"\",\n            \"terminal_no\": \"MyPosT00001\"\n        },\n        \"payChannel\": \"U\"\n    },\n    \"signature\": \"{{signature}}\",\n    \"suffix\": {\n        \"mid\": \"100122220000005\"\n    }\n}"},"url":"https://api.motionpay.org/payment/pay/order","description":"<h3 id=\"31-merchant-scan-customer-mobile\">3.1 Merchant Scan Customer Mobile</h3>\n<p>This solution, Merchant Scan Customer Mobile, enables merchants to collect money by scanning the barcode/QR code (Auth code) displayed on a customer's payment APP. Payment rails is unnecessary to be specified, which can be distinguished by Motion Pay Host.</p>\n<p><strong>Sequence Chart</strong></p>\n<p><img src=\"https://demo.motionpay.org/images/AuthcodeFlowDiagram.png\" alt=\"avatar\" /></p>\n<p><strong>Endpoint</strong></p>\n<p>pay/order</p>\n<p><strong>Http Method</strong></p>\n<p>POST</p>\n<p><strong>Http Header</strong></p>\n<p>Content-Type:application/json</p>\n<p><strong>API POST Action URL:</strong></p>\n<p><a href=\"https://api.motionpay.org/payment/pay/order\">https://api.motionpay.org/payment/pay/order</a></p>\n<p><strong>Merchant Request Parameters:</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>parameters</th>\n<th>type</th>\n<th>Empty</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>param</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>amount</td>\n<td>INT</td>\n<td>N</td>\n<td>Transaction amount, value in cents. For example: $100.00 is 10000</td>\n</tr>\n<tr>\n<td>authCode</td>\n<td>String</td>\n<td>Y</td>\n<td>Auth code from WechatPay or AliPay. You can get it from the scanner</td>\n</tr>\n<tr>\n<td>payChannel</td>\n<td>String</td>\n<td>N</td>\n<td>Scan Mobile: \"U\", Mobile Scan QR code, AliPay: \"A\", WechatPay: \"W\"</td>\n</tr>\n<tr>\n<td>merchantOrderNo</td>\n<td>String</td>\n<td>N</td>\n<td>Merchant order number. It has to be unique for each transaction request. One order could have many transaction request</td>\n</tr>\n<tr>\n<td>flag</td>\n<td>String</td>\n<td>Y</td>\n<td>Empty for Scan Mobile. For mobile scan QR code: AliPay:\"alipay_native\", WechatPay:\"weixin_native\"</td>\n</tr>\n<tr>\n<td><strong>paramJsonObject</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>goods_info</td>\n<td>String</td>\n<td>N</td>\n<td>Product Information (less than 128 characters)</td>\n</tr>\n<tr>\n<td>spbill_create_ip</td>\n<td>String</td>\n<td>N</td>\n<td>The POS merchine IP Address(It is required for WechatPay)</td>\n</tr>\n<tr>\n<td>terminal_no</td>\n<td>String</td>\n<td>N</td>\n<td>Terminal Number</td>\n</tr>\n<tr>\n<td><strong>suffix</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>mid</td>\n<td>String</td>\n<td>N</td>\n<td>Merchant ID</td>\n</tr>\n<tr>\n<td>language</td>\n<td>String</td>\n<td>N</td>\n<td>The language for error message. Value: (zh,en,fr)If this parameter is not in the request, the error message in English will be returned.</td>\n</tr>\n<tr>\n<td><strong>signature</strong></td>\n<td>String</td>\n<td>N</td>\n<td>signValue</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Response parameters:</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>code</td>\n<td>String</td>\n<td>Response code (0 is success)</td>\n</tr>\n<tr>\n<td>message</td>\n<td>String</td>\n<td>Response Description</td>\n</tr>\n<tr>\n<td>realPath</td>\n<td>String</td>\n<td>For scan mobile, it is empty. For mobile scan, it is the QR Code URL</td>\n</tr>\n<tr>\n<td><strong>result</strong></td>\n<td>JSON</td>\n<td></td>\n</tr>\n<tr>\n<td>err_code</td>\n<td>INT</td>\n<td>If the value is '999', call the 'queryOrder' API Interface is required every 30 seconds.</td>\n</tr>\n<tr>\n<td><strong>orderDef</strong></td>\n<td>JSON</td>\n<td></td>\n</tr>\n<tr>\n<td>orderNo</td>\n<td>String</td>\n<td>Order number</td>\n</tr>\n<tr>\n<td>tranCode</td>\n<td>String</td>\n<td>Transaction code (813: AliPay, 814: WechatPay)</td>\n</tr>\n<tr>\n<td>amount</td>\n<td>INT</td>\n<td>Transaction Amount. For Example:$123.45 is 12345</td>\n</tr>\n<tr>\n<td>cnyAmount</td>\n<td>INT</td>\n<td>Transaction Amount in CNY in cents. RMB Amount</td>\n</tr>\n<tr>\n<td>state</td>\n<td>INT</td>\n<td>Transaction State (1: Paying, 2: Paid, 3: Refund, 4: Closed(QR code expired), 5: Cancelled )Please be advised the partially refund state is 2: Paid. The fully refund state is 3: refund.</td>\n</tr>\n<tr>\n<td>payType</td>\n<td>String</td>\n<td>A: AliPay, W: WechatPay</td>\n</tr>\n<tr>\n<td>mnFlag</td>\n<td>String</td>\n<td>always be \"micro\"</td>\n</tr>\n<tr>\n<td>utcTimes</td>\n<td>String</td>\n<td>UTC Time</td>\n</tr>\n<tr>\n<td>exchangeRate</td>\n<td>Long</td>\n<td>Exchange Rate</td>\n</tr>\n<tr>\n<td>payTime</td>\n<td>String</td>\n<td>Payment Time GMT+8</td>\n</tr>\n<tr>\n<td>tranLogId</td>\n<td>String</td>\n<td>Transaction Log Id</td>\n</tr>\n<tr>\n<td>merchantOrderNo</td>\n<td>String</td>\n<td>Merchant Order Number</td>\n</tr>\n</tbody>\n</table>\n</div><p>Sample of stringSignTemp for Scan Mobile (paychannel is U):</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>amount=1&amp;authcode=134583657133882637&amp;merchantorderno=2018081106176844&amp;paramjsonobject={\"goods_info\":\"Test_Product\",\"spbill_create_ip\":\"192.168.2.253\",\"store_id\":\"\",\"terminal_no\":\"MyPosT00001\"}&amp;paychannel=U&amp;appid=5005642017008&amp;appsecret=cd3f5e88a1ec1df2351cdca75d7ce94a\n</code></pre><p>Sample of signValue generated by SHA1:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>57351cedc47a8aa71b5405606148f96b6b44974e\n</code></pre>","urlObject":{"protocol":"https","path":["payment","pay","order"],"host":["api","motionpay","org"],"query":[],"variable":[]}},"response":[{"id":"efc1f4b2-f16f-4b76-8f90-51a515e44e0a","name":"Order","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"amount\": 1,\n        \"authCode\": \"{{authCode}}\",\n        \"merchantOrderNo\": \"{{orderNo}}\",\n        \"paramJsonObject\": {\n            \"goods_info\": \"Test_Product\",\n            \"spbill_create_ip\": \"192.168.2.253\",\n            \"store_id\": \"\",\n            \"terminal_no\": \"MyPosT00001\"\n        },\n        \"payChannel\": \"U\"\n    },\n    \"signature\": \"{{signature}}\",\n    \"suffix\": {\n        \"mid\": \"100122220000005\"\n    }\n}"},"url":"https://api.motionpay.org/payment/pay/order"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sat, 12 Jan 2019 20:12:51 GMT"},{"key":"Content-Type","value":"application/json;charset=UTF-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"Apache-Coyote/1.1"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": \"0\",\n    \"message\": \"success\",\n    \"result\": {\n        \"orderDef\": {\n            \"orderNo\": \"02100100010000010201901130010\",\n            \"tranCode\": \"814\",\n            \"amount\": 1,\n            \"cnyAmount\": 0,\n            \"sn\": \"MyPosT00001\",\n            \"state\": 1,\n            \"payType\": \"W\",\n            \"mnFlag\": \"micro\",\n            \"refundAmount\": 0,\n            \"utcTimes\": \"2019-01-13 04:12:51\",\n            \"exchangeRate\": 5.1444,\n            \"payTime\": \"2019-01-12 16:12:50\",\n            \"merchantOrderNo\": \"20190112151250\",\n            \"tranLogId\": \"P100100010000010201901130008\"\n        },\n        \"err_code\": 999\n    }\n}"}],"_postman_id":"46ac6552-cbbd-4c7c-8870-5a1540a79bbe"},{"name":"Customer Mobile Scan Merchant Order","event":[{"listen":"prerequest","script":{"id":"2bb0ee85-f226-45c5-b2a8-1cf8610b5883","exec":["","mobileScanOrderNo = \"\";","","function pad2(n) { return n < 10 ? '0' + n : n }","","var date = new Date();","","mobileScanOrderNo = date.getFullYear().toString() + pad2(date.getMonth() + 1) + pad2( date.getDate()) + pad2( date.getHours() ) + pad2( date.getMinutes() ) + pad2( date.getSeconds() ) ;","","mobileScanOrderNo = mobileScanOrderNo.toString();","","console.log('mobileScanOrderNo',mobileScanOrderNo);","","pra = {\"goods_info\":\"Test_Product\",\"spbill_create_ip\":\"192.168.2.253\",\"store_id\":\"\",\"terminal_no\":\"MyPosT00001\"};","console.log('pra',pra);","","requestBody =\"amount=1&flag=weixin_native&merchantorderno=\"+mobileScanOrderNo+\"&paramjsonobject=\"+JSON.stringify(pra)+\"&paychannel=W&appid=5005642019001&appsecret=ae26b1841a7291379db606e41bfa4417\";","","","console.log('requestBody',requestBody);","","var mobileScanSignature = \"\";","","if(requestBody){","    // SHA1 hash","    mobileScanSignature = CryptoJS.SHA1(requestBody);","}","","postman.setGlobalVariable(\"mobileScanSignature\", mobileScanSignature);","postman.setGlobalVariable(\"mobileScanOrderNo\", mobileScanOrderNo);","","console.log('mobileScanSignature',mobileScanSignature);","","",""],"type":"text/javascript"}}],"id":"08e1edab-e729-4760-9941-6214d34bb91e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"amount\": 1,\n        \"flag\": \"weixin_native\",\n        \"merchantOrderNo\": \"{{mobileScanOrderNo}}\",\n        \"paramJsonObject\": {\n            \"goods_info\": \"Test_Product\",\n            \"spbill_create_ip\": \"192.168.2.253\",\n            \"store_id\": \"\",\n            \"terminal_no\": \"MyPosT00001\"\n        },\n        \"payChannel\": \"W\"\n    },\n    \"signature\": \"{{mobileScanSignature}}\",\n    \"suffix\": {\n        \"mid\": \"100122220000005\"\n    }\n}"},"url":"https://api.motionpay.org/payment/pay/order","description":"<h3 id=\"32-customer-mobile-scan-merchant\">3.2 Customer Mobile Scan Merchant</h3>\n<p>A customer uses payment APP to scan a dynamic transaction QR code displayed by a merchant and authorizes the payment with/without keying a payment password in the payment APP.</p>\n<p><strong>Sequence Chart</strong></p>\n<p><img src=\"https://demo.motionpay.org/images/QRcodeFlowDiagram.png\" alt=\"avatar\" /></p>\n<p><strong>Endpoint</strong></p>\n<p>pay/order</p>\n<p><strong>Http Method</strong></p>\n<p>POST</p>\n<p><strong>Http Header</strong></p>\n<p>Content-Type:application/json</p>\n<p><strong>API POST Action URL:</strong></p>\n<p><a href=\"https://api.motionpay.org/payment/pay/order\">https://api.motionpay.org/payment/pay/order</a></p>\n<p><strong>Merchant Request Parameters:</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>parameters</th>\n<th>type</th>\n<th>Empty</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>param</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>amount</td>\n<td>INT</td>\n<td>N</td>\n<td>Transaction amount, value in cents. For example: $100.00 is 10000</td>\n</tr>\n<tr>\n<td>authCode</td>\n<td>String</td>\n<td>Y</td>\n<td>Auth code from WechatPay or AliPay. You can get it from the scanner</td>\n</tr>\n<tr>\n<td>payChannel</td>\n<td>String</td>\n<td>N</td>\n<td>Scan Mobile: \"U\", Mobile Scan QR code, AliPay: \"A\", WechatPay: \"W\"</td>\n</tr>\n<tr>\n<td>merchantOrderNo</td>\n<td>String</td>\n<td>N</td>\n<td>Merchant order number. It has to be unique for each transaction request. One order could have many transaction request</td>\n</tr>\n<tr>\n<td>flag</td>\n<td>String</td>\n<td>Y</td>\n<td>Empty for Scan Mobile. For mobile scan QR code: AliPay:\"alipay_native\", WechatPay:\"weixin_native\"</td>\n</tr>\n<tr>\n<td><strong>paramJsonObject</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>goods_info</td>\n<td>String</td>\n<td>N</td>\n<td>Product Information (less than 128 characters)</td>\n</tr>\n<tr>\n<td>spbill_create_ip</td>\n<td>String</td>\n<td>N</td>\n<td>The POS merchine IP Address(It is required for WechatPay)</td>\n</tr>\n<tr>\n<td>terminal_no</td>\n<td>String</td>\n<td>N</td>\n<td>Terminal Number</td>\n</tr>\n<tr>\n<td><strong>suffix</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>mid</td>\n<td>String</td>\n<td>N</td>\n<td>Merchant ID</td>\n</tr>\n<tr>\n<td>language</td>\n<td>String</td>\n<td>N</td>\n<td>The language for error message. Value: (zh,en,fr)If this parameter is not in the request, the error message in English will be returned.</td>\n</tr>\n<tr>\n<td><strong>signature</strong></td>\n<td>String</td>\n<td>N</td>\n<td>signValue</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Response parameters:</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>code</td>\n<td>String</td>\n<td>Response code (0 is success)</td>\n</tr>\n<tr>\n<td>message</td>\n<td>String</td>\n<td>Response Description</td>\n</tr>\n<tr>\n<td>realPath</td>\n<td>String</td>\n<td>For scan mobile, it is empty. For mobile scan, it is the QR Code URL</td>\n</tr>\n<tr>\n<td><strong>result</strong></td>\n<td>JSON</td>\n<td></td>\n</tr>\n<tr>\n<td>err_code</td>\n<td>INT</td>\n<td>If the value is '999', call the 'queryOrder' API Interface is required every 30 seconds.</td>\n</tr>\n<tr>\n<td><strong>orderDef</strong></td>\n<td>JSON</td>\n<td></td>\n</tr>\n<tr>\n<td>orderNo</td>\n<td>String</td>\n<td>Order number</td>\n</tr>\n<tr>\n<td>tranCode</td>\n<td>String</td>\n<td>Transaction code (813: AliPay, 814: WechatPay)</td>\n</tr>\n<tr>\n<td>amount</td>\n<td>INT</td>\n<td>Transaction Amount. For Example:$123.45 is 12345</td>\n</tr>\n<tr>\n<td>cnyAmount</td>\n<td>INT</td>\n<td>Transaction Amount in CNY in cents. RMB Amount</td>\n</tr>\n<tr>\n<td>state</td>\n<td>INT</td>\n<td>Transaction State (1: Paying, 2: Paid, 3: Refund, 4: Closed(QR code expired), 5: Cancelled )Please be advised the partially refund state is 2: Paid. The fully refund state is 3: refund.</td>\n</tr>\n<tr>\n<td>payType</td>\n<td>String</td>\n<td>A: AliPay, W: WechatPay</td>\n</tr>\n<tr>\n<td>mnFlag</td>\n<td>String</td>\n<td>always be \"micro\"</td>\n</tr>\n<tr>\n<td>utcTimes</td>\n<td>String</td>\n<td>UTC Time</td>\n</tr>\n<tr>\n<td>exchangeRate</td>\n<td>Long</td>\n<td>Exchange Rate</td>\n</tr>\n<tr>\n<td>payTime</td>\n<td>String</td>\n<td>Payment Time GMT+8</td>\n</tr>\n<tr>\n<td>tranLogId</td>\n<td>String</td>\n<td>Transaction Log Id</td>\n</tr>\n<tr>\n<td>merchantOrderNo</td>\n<td>String</td>\n<td>Merchant Order Number</td>\n</tr>\n</tbody>\n</table>\n</div><p>Sample of stringSignTemp for Mobile Scan AliPay QR code (paychannel is A):</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>amount=1&amp;flag=alipay_native&amp;merchantorderno=2018081176531634&amp;paramjsonobject={\"goods_info\":\"Test_Product\",\"spbill_create_ip\":\"192.168.2.253\",\"store_id\":\"\",\"terminal_no\":\"MyPosT00001\"}&amp;paychannel=A&amp;appid=5005642017008&amp;appsecret=cd3f5e88a1ec1df2351cdca75d7ce94a\n</code></pre><p>Sample of signValue generated by SHA1:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>d602f9b35316144a52b9b9774313d0a486071997\n</code></pre><p>Sample of the JSON string request for Mobile Scan AliPay QR code (paychannel is A):</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"param\": {\n        \"amount\": 1,\n        \"flag\": \"alipay_native\",\n        \"merchantOrderNo\": \"{{mobileScanOrderNo}}\",\n        \"paramJsonObject\": {\n            \"goods_info\": \"Test_Product\",\n            \"spbill_create_ip\": \"192.168.2.253\",\n            \"store_id\": \"\",\n            \"terminal_no\": \"MyPosT00001\"\n        },\n        \"payChannel\": \"A\"\n    },\n    \"signature\": \"{{mobileScanSignature}}\",\n    \"suffix\": {\n        \"mid\": \"100100010000010\"\n    }\n}\n</code></pre><p>Sample of stringSignTemp for Mobile Scan WeChat QR code (paychannel is W):</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>amount=1&amp;flag=weixin_native&amp;merchantorderno=2018081127868566&amp;paramjsonobject={\"goods_info\":\"Test_Product\",\"spbill_create_ip\":\"192.168.2.253\",\"store_id\":\"\",\"terminal_no\":\"MyPosT00001\"}&amp;paychannel=W&amp;appid=5005642017008&amp;appsecret=cd3f5e88a1ec1df2351cdca75d7ce94a\n</code></pre><p>Sample of signValue generated by SHA1:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>cd170836360065a739952e257dbc3bb8e2710747 \n</code></pre><p>Sample of the JSON string request for Mobile Scan WeChat QR code (paychannel is W):</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"param\": {\n        \"amount\": 1,\n        \"flag\": \"weixin_native\",\n        \"merchantOrderNo\": \"{{mobileScanOrderNo}}\",\n        \"paramJsonObject\": {\n            \"goods_info\": \"Test_Product\",\n            \"spbill_create_ip\": \"192.168.2.253\",\n            \"store_id\": \"\",\n            \"terminal_no\": \"MyPosT00001\"\n        },\n        \"payChannel\": \"W\"\n    },\n    \"signature\": \"{{mobileScanSignature}}\",\n    \"suffix\": {\n        \"mid\": \"100100010000010\"\n    }\n}\n</code></pre>","urlObject":{"protocol":"https","path":["payment","pay","order"],"host":["api","motionpay","org"],"query":[],"variable":[]}},"response":[{"id":"6efd3aaa-902e-491b-88a7-a3b792d61001","name":"mobile scan","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"amount\": 1,\n        \"flag\": \"weixin_native\",\n        \"merchantOrderNo\": \"{{mobileScanOrderNo}}\",\n        \"paramJsonObject\": {\n            \"goods_info\": \"Test_Product\",\n            \"spbill_create_ip\": \"192.168.2.253\",\n            \"store_id\": \"\",\n            \"terminal_no\": \"MyPosT00001\"\n        },\n        \"payChannel\": \"W\"\n    },\n    \"signature\": \"{{mobileScanSignature}}\",\n    \"suffix\": {\n        \"mid\": \"100122220000005\"\n    }\n}"},"url":"https://api.motionpay.org/payment/pay/order"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sat, 12 Jan 2019 20:59:01 GMT"},{"key":"Content-Type","value":"application/json;charset=UTF-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"Apache-Coyote/1.1"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": \"0\",\n    \"message\": \"success\",\n    \"result\": {\n        \"msg\": \"SUCCESS\",\n        \"orderDef\": {\n            \"orderNo\": \"02100100010000010201901130011\",\n            \"tranCode\": \"814\",\n            \"amount\": 1,\n            \"cnyAmount\": 0,\n            \"sn\": \"MyPosT00001\",\n            \"state\": 1,\n            \"payType\": \"W\",\n            \"mnFlag\": \"native\",\n            \"refundAmount\": 0,\n            \"utcTimes\": \"2019-01-13 04:59:00\",\n            \"exchangeRate\": 5.1444,\n            \"payTime\": \"2019-01-12 16:59:00\",\n            \"merchantOrderNo\": \"20190112155859\",\n            \"tranLogId\": \"P100100010000010201901130009\"\n        },\n        \"realPath\": \"weixin://wxpay/bizpayurl?pr=rqCgVfW\"\n    }\n}"}],"_postman_id":"08e1edab-e729-4760-9941-6214d34bb91e"},{"name":"queryOrder","event":[{"listen":"prerequest","script":{"id":"820ca7ad-797b-4ff7-91f1-1309eff06db0","exec":["requestBody = \"merchantorderno=20190112155859&appid=5005642019001&appsecret=ae26b1841a7291379db606e41bfa4417\";","var signature = \"\";","","if(requestBody){","    // SHA1 hash","    signature = CryptoJS.SHA1(requestBody);","}","","postman.setGlobalVariable(\"signature\", signature);","","console.log('abc',signature);"],"type":"text/javascript"}}],"id":"8424b2a5-e769-472d-8b8a-084e49d4e540","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"merchantOrderNo\": \"20190112155859\"\n    },\n    \"suffix\": {\n        \"mid\": \"100122220000005\"\n    },\n    \"signature\": \"{{signature}}\"\n}"},"url":"https://api.motionpay.org/payment/pay/queryOrder","description":"<h3 id=\"33-query-interface\">3.3 Query Interface</h3>\n<p>Inquire merchant's order status and details by order number.</p>\n<p><strong>Endpoint</strong></p>\n<p>pay/queryOrder</p>\n<p><strong>Http Method</strong></p>\n<p>POST</p>\n<p><strong>Http Header</strong></p>\n<p>Content-Type:application/json</p>\n<p><strong>API POST Action URL:</strong></p>\n<p><a href=\"https://api.motionpay.org/payment/pay/queryOrder\">https://api.motionpay.org/payment/pay/queryOrder</a></p>\n<p><strong>Merchant Request Parameters:</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Empty</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>param</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>merchantOrderNo</td>\n<td>String</td>\n<td>N</td>\n<td>Merchant Order Number</td>\n</tr>\n<tr>\n<td>orderNo</td>\n<td>String</td>\n<td>Y</td>\n<td>Order Number</td>\n</tr>\n<tr>\n<td><strong>suffix</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>mid</td>\n<td>String</td>\n<td>N</td>\n<td>Merchant Id</td>\n</tr>\n<tr>\n<td>language</td>\n<td>String</td>\n<td>N</td>\n<td>The language for error message. Value: (zh,en,fr)If this parameter is not in the request, the error message in English will be returned.</td>\n</tr>\n<tr>\n<td><strong>signature</strong></td>\n<td>String</td>\n<td>N</td>\n<td>signValue</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Response parameters:</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>code</td>\n<td>String</td>\n<td>Response Code (0 is success)</td>\n</tr>\n<tr>\n<td>message</td>\n<td>String</td>\n<td>Response Description</td>\n</tr>\n<tr>\n<td><strong>result</strong></td>\n<td>JSON</td>\n<td></td>\n</tr>\n<tr>\n<td>orderNo</td>\n<td>String</td>\n<td>Order Number</td>\n</tr>\n<tr>\n<td>tranCode</td>\n<td>String</td>\n<td>Transaction Code(813: AliPay 814: WechatPay)</td>\n</tr>\n<tr>\n<td>amount</td>\n<td>INT</td>\n<td>Transaction Amount in cents. For Example: $100 is 10000</td>\n</tr>\n<tr>\n<td>refundAmount</td>\n<td>INT</td>\n<td>Total refunded Amount in cents.For Example: $100 is 10000.</td>\n</tr>\n<tr>\n<td>cnyAmount</td>\n<td>INT</td>\n<td>CNY Transaction Amount in cents. RMB Amount</td>\n</tr>\n<tr>\n<td>state</td>\n<td>INT</td>\n<td>Transaction State (1: Paying, 2: Paid, 3: Refund, 4: Closed(QR code expired), 5: Cancelled )Please be advised the partially refund state is 2: Paid. The fully refund state is 3: refund.</td>\n</tr>\n<tr>\n<td>payType</td>\n<td>String</td>\n<td>A: AliPay, W: WechatPay</td>\n</tr>\n<tr>\n<td>mnFlag</td>\n<td>String</td>\n<td>\"micro\"</td>\n</tr>\n<tr>\n<td>utcTimes</td>\n<td>String</td>\n<td>UTC Time</td>\n</tr>\n<tr>\n<td>exchangeRate</td>\n<td>Long</td>\n<td>Exchange Rate</td>\n</tr>\n<tr>\n<td>payTime</td>\n<td>String</td>\n<td>Transaction Time, GMT+8</td>\n</tr>\n<tr>\n<td>tranLogId</td>\n<td>String</td>\n<td>Transaction Log Id</td>\n</tr>\n<tr>\n<td>merchantOrderNo</td>\n<td>String</td>\n<td>Merchant Order Number</td>\n</tr>\n</tbody>\n</table>\n</div><p>Sample of stringSignTemp for query function:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>merchantorderno=2018081127868566&amp;appid=5005642017008&amp;appsecret=cd3f5e88a1ec1df2351cdca75d7ce94a\n</code></pre><p>Sample of signValue generated by SHA1:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>21264fcf4127bdf77984042456e0c96c6353a5a3 \n</code></pre><p>Sample of merchant request：</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"param\": {\n        \"merchantOrderNo\": \"20190112155859\"\n    },\n    \"suffix\": {\n        \"mid\": \"100100010000010\"\n    },\n    \"signature\": \"{{signature}}\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["payment","pay","queryOrder"],"host":["api","motionpay","org"],"query":[],"variable":[]}},"response":[{"id":"685fbc57-cf08-4e40-af2f-2478d77bb413","name":"queryOrder","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"merchantOrderNo\": \"20190112155859\"\n    },\n    \"suffix\": {\n        \"mid\": \"100122220000005\"\n    },\n    \"signature\": \"{{signature}}\"\n}"},"url":"https://api.motionpay.org/payment/pay/queryOrder"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sat, 12 Jan 2019 21:01:19 GMT"},{"key":"Content-Type","value":"application/json;charset=UTF-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"Apache-Coyote/1.1"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": \"0\",\n    \"message\": \"success\",\n    \"result\": {\n        \"orderNo\": \"02100100010000010201901130011\",\n        \"tranCode\": \"814\",\n        \"amount\": 1,\n        \"cnyAmount\": 0,\n        \"sn\": \"MyPosT00001\",\n        \"state\": 2,\n        \"payType\": \"W\",\n        \"thirdTradeNo\": \"4200000248201901136114085973\",\n        \"mnFlag\": \"native\",\n        \"refundAmount\": 0,\n        \"thirdExtId\": \"o8HL9wfy1jPCnfVFZam8fJWTuHP4\",\n        \"utcTimes\": \"2019-01-13 04:59:00\",\n        \"exchangeRate\": 5.1444,\n        \"payTime\": \"2019-01-12 16:59:00\",\n        \"merchantOrderNo\": \"20190112155859\",\n        \"tranLogId\": \"P100100010000010201901130009\"\n    }\n}"},{"id":"80a2551b-42c3-4c5b-8335-33d88a1d30ab","name":"queryOrder","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"merchantOrderNo\": \"20190112155859\"\n    },\n    \"suffix\": {\n        \"mid\": \"100122220000005\"\n    },\n    \"signature\": \"{{signature}}\"\n}"},"url":"https://api.motionpay.org/payment/pay/queryOrder"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sat, 12 Jan 2019 21:01:19 GMT"},{"key":"Content-Type","value":"application/json;charset=UTF-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"Apache-Coyote/1.1"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": \"0\",\n    \"message\": \"success\",\n    \"result\": {\n        \"orderNo\": \"02100100010000010201901130011\",\n        \"tranCode\": \"814\",\n        \"amount\": 1,\n        \"cnyAmount\": 0,\n        \"sn\": \"MyPosT00001\",\n        \"state\": 2,\n        \"payType\": \"W\",\n        \"thirdTradeNo\": \"4200000248201901136114085973\",\n        \"mnFlag\": \"native\",\n        \"refundAmount\": 0,\n        \"thirdExtId\": \"o8HL9wfy1jPCnfVFZam8fJWTuHP4\",\n        \"utcTimes\": \"2019-01-13 04:59:00\",\n        \"exchangeRate\": 5.1444,\n        \"payTime\": \"2019-01-12 16:59:00\",\n        \"merchantOrderNo\": \"20190112155859\",\n        \"tranLogId\": \"P100100010000010201901130009\"\n    }\n}"}],"_postman_id":"8424b2a5-e769-472d-8b8a-084e49d4e540"},{"name":"refund","event":[{"listen":"prerequest","script":{"id":"84f036da-0bbd-46cf-a27b-f6ebc42a1665","exec":["requestBody = \"orderno=02100100010000010201901130004&refundamount=1&trancode=814&tranlogid=P100100010000010201901130004&appid=5005642019001&appsecret=ae26b1841a7291379db606e41bfa4417\";","var refundSignature = \"\";","","if(requestBody){","    // SHA1 hash","    refundSignature = CryptoJS.SHA1(requestBody);","}","","postman.setGlobalVariable(\"refundSignature\", refundSignature);","","console.log('abc',refundSignature);"],"type":"text/javascript"}}],"id":"11e45274-7453-4325-a02d-b5cf87bbeabc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"orderNo\": \"02100100010000010201901130004\",\n        \"refundAmount\": 1,\n        \"tranCode\": \"814\",\n        \"tranLogId\": \"P100100010000010201901130004\"\n    },\n    \"suffix\": {\n        \"mid\": \"100122220000005\"\n    },\n    \"signature\": \"{{refundSignature}}\"\n}"},"url":"https://api.motionpay.org/payment/pay/revoke","description":"<h3 id=\"34-refund-interface\">3.4 Refund Interface</h3>\n<p>The refund interface can request a full/partial refund.</p>\n<p><strong>Endpoint</strong></p>\n<p>pay/revoke</p>\n<p><strong>Http Method</strong></p>\n<p>POST</p>\n<p><strong>Http Header</strong></p>\n<p>Content-Type:application/json</p>\n<p><strong>API POST Action URL:</strong></p>\n<p><a href=\"https://api.motionpay.org/payment/pay/revoke\">https://api.motionpay.org/payment/pay/revoke</a></p>\n<p><strong>Merchant Request Parameters:</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Empty</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>param</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>tranCode</td>\n<td>String</td>\n<td>N</td>\n<td>Transaction Code</td>\n</tr>\n<tr>\n<td>orderNo</td>\n<td>String</td>\n<td>N</td>\n<td>Order Number</td>\n</tr>\n<tr>\n<td>refundAmount</td>\n<td>INT</td>\n<td>N</td>\n<td>Refund amount, must less or equal paid amount.If the refund amount is greater than the paid amount, error code: 241 will be returned. You can use the query interface to find out the total refunded amount.Return JSON String:\"code\":\"241\"</td>\n</tr>\n<tr>\n<td>tranLogId</td>\n<td>String</td>\n<td>N</td>\n<td>Transaction Log Id</td>\n</tr>\n<tr>\n<td><strong>suffix</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>mid</td>\n<td>String</td>\n<td>N</td>\n<td>Merchant Id</td>\n</tr>\n<tr>\n<td>language</td>\n<td>String</td>\n<td>N</td>\n<td>The language for error message. Value: (zh,en,fr)If this parameter is not in the request, the error message in English will be returned.</td>\n</tr>\n<tr>\n<td><strong>signature</strong></td>\n<td>String</td>\n<td>N</td>\n<td>signValue</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Response parameters:</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>code</td>\n<td>String</td>\n<td>Response Code (0 is success)</td>\n</tr>\n<tr>\n<td>message</td>\n<td>String</td>\n<td>Response Description</td>\n</tr>\n<tr>\n<td><strong>result</strong></td>\n<td>JSON</td>\n<td></td>\n</tr>\n<tr>\n<td>orderNo</td>\n<td>String</td>\n<td>Order Number</td>\n</tr>\n<tr>\n<td>tranCode</td>\n<td>String</td>\n<td>Transaction Code(820: AliPay Revoke/Refund, 809: Wechat Revoke/Refund)</td>\n</tr>\n<tr>\n<td>amount</td>\n<td>INT</td>\n<td>Transaction Amount in cents. For Example: $100 is 10000</td>\n</tr>\n<tr>\n<td>cnyAmount</td>\n<td>INT</td>\n<td>CNY Transaction Amount in cents. RMB Amount</td>\n</tr>\n<tr>\n<td>state</td>\n<td>INT</td>\n<td>Transaction State (1: Paying, 2: Paid, 3: Refund, 4: Closed(QR code expired), 5: Cancelled )Please be advised the partially refund state is 2: Paid. The fully refund state is 3: refund.</td>\n</tr>\n<tr>\n<td>payType</td>\n<td>String</td>\n<td>A: AliPay, W: WechatPay</td>\n</tr>\n<tr>\n<td>mnFlag</td>\n<td>String</td>\n<td>\"micro\"</td>\n</tr>\n<tr>\n<td>utcTimes</td>\n<td>String</td>\n<td>UTC Time</td>\n</tr>\n<tr>\n<td>exchangeRate</td>\n<td>Long</td>\n<td>Exchange Rate</td>\n</tr>\n<tr>\n<td>payTime</td>\n<td>String</td>\n<td>Transaction Time, GMT+8</td>\n</tr>\n<tr>\n<td>thirdTradeNo</td>\n<td>String</td>\n<td>Third Party Transaction Number (Transaction Number from AliPay or WechatPay)</td>\n</tr>\n<tr>\n<td>tranDesc</td>\n<td>String</td>\n<td>Transaction Description</td>\n</tr>\n<tr>\n<td>refundAmount</td>\n<td>INT</td>\n<td>Refund Amount in cents</td>\n</tr>\n</tbody>\n</table>\n</div><p>Sample of stringSignTemp for refund function:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>orderno=02100100010000010201808110014&amp;refundamount=1&amp;trancode=814&amp;tranlogid=P100100010000010201808110019&amp;appid=5005642017008&amp;appsecret=cd3f5e88a1ec1df2351cdca75d7ce94a \n</code></pre><p>Sample of signValue generated by SHA1:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>74bb2155f74b11f9a235b09ba2011961423ce7af \n</code></pre><p>Sample of merchant request：</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"param\": {\n        \"orderNo\": \"02100100010000010201901130004\",\n        \"refundAmount\": 1,\n        \"tranCode\": \"814\",\n        \"tranLogId\": \"P100100010000010201901130004\"\n    },\n    \"suffix\": {\n        \"mid\": \"100100010000010\"\n    },\n    \"signature\": \"{{refundSignature}}\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["payment","pay","revoke"],"host":["api","motionpay","org"],"query":[],"variable":[]}},"response":[{"id":"288ac394-c0ae-49b4-b119-31c83376b45f","name":"refund","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"orderNo\": \"02100100010000010201901130004\",\n        \"refundAmount\": 1,\n        \"tranCode\": \"814\",\n        \"tranLogId\": \"P100100010000010201901130004\"\n    },\n    \"suffix\": {\n        \"mid\": \"100122220000005\"\n    },\n    \"signature\": \"{{refundSignature}}\"\n}"},"url":"https://api.motionpay.org/payment/pay/revoke"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sat, 12 Jan 2019 19:54:08 GMT"},{"key":"Content-Type","value":"application/json;charset=UTF-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"Apache-Coyote/1.1"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": \"0\",\n    \"message\": \"success\",\n    \"result\": {\n        \"tranTime\": \"2019-01-12 15:54:08\",\n        \"cnTime\": \"2019-01-13 03:54:08\",\n        \"tranCode\": \"820\",\n        \"subTranCode\": \"820\",\n        \"tranAmount\": -1,\n        \"cnyAmount\": -5,\n        \"inputAmount\": -1,\n        \"orderNo\": \"02100100010000010201901130007\",\n        \"thirdTradeNo\": \"4200000261201901130788730205\",\n        \"tranDesc\": \"WechatPay Refund\",\n        \"refundAmount\": -1,\n        \"payTime\": \"2019-01-12 15:54:08\",\n        \"tranLogId\": \"P100100010000010201901130005\"\n    }\n}"}],"_postman_id":"11e45274-7453-4325-a02d-b5cf87bbeabc"},{"name":"cancel","event":[{"listen":"prerequest","script":{"id":"f9617682-5d24-4323-93c6-bc0b37e3f7d1","exec":["requestBody = \"orderno=02100100010000010201901130010&trancode=814&tranlogid=P100100010000010201901130008&appid=5005642019001&appsecret=ae26b1841a7291379db606e41bfa4417\"","","var cancelSignature = \"\";","","if(requestBody){","    // SHA1 hash","    cancelSignature = CryptoJS.SHA1(requestBody);","}","","postman.setGlobalVariable(\"cancelSignature\", cancelSignature);","","console.log('canselSignature',cancelSignature);"],"type":"text/javascript"}}],"id":"c887b89b-7498-4cef-b9ed-4c45ea13e0bc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"tranCode\": \"814\",\n        \"orderNo\": \"02100100010000010201901130010\",\n        \"tranLogId\": \"P100100010000010201901130008\"\n    },\n    \"suffix\": {\n        \"mid\": \"100122220000005\",\n        \"lang\": \"en\"\n       \n    },\n    \"signature\": \"{{cancelSignature}}\"\n}"},"url":"https://api.motionpay.org/payment/pay/cancel","description":"<h3 id=\"35-cancel-interface\">3.5 Cancel Interface</h3>\n<p>During the purchase process, merchants can reverse/cancel the transaction.</p>\n<p><strong>Endpoint</strong></p>\n<p>pay/cancel</p>\n<p><strong>Http Method</strong></p>\n<p>POST</p>\n<p><strong>Http Header</strong></p>\n<p>Content-Type:application/json</p>\n<p><strong>API POST Action URL:</strong></p>\n<p><a href=\"https://api.motionpay.org/payment/pay/cancel\">https://api.motionpay.org/payment/pay/cancel</a></p>\n<p>Merchant Request Parameters:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Empty</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>param</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>tranCode</td>\n<td>String</td>\n<td>N</td>\n<td>Transaction Code</td>\n</tr>\n<tr>\n<td>orderNo</td>\n<td>String</td>\n<td>N</td>\n<td>Order Number</td>\n</tr>\n<tr>\n<td>refundAmount</td>\n<td>INT</td>\n<td>N</td>\n<td>Refund amount, must less or equal paid amount</td>\n</tr>\n<tr>\n<td>tranLogId</td>\n<td>String</td>\n<td>N</td>\n<td>Transaction Log Id</td>\n</tr>\n<tr>\n<td><strong>suffix</strong></td>\n<td>JSON</td>\n<td>N</td>\n<td></td>\n</tr>\n<tr>\n<td>mid</td>\n<td>String</td>\n<td>N</td>\n<td>Merchant Id</td>\n</tr>\n<tr>\n<td>language</td>\n<td>String</td>\n<td>N</td>\n<td>The language for error message. Value: (zh,en,fr)If this parameter is not in the request, the error message in English will be returned.</td>\n</tr>\n<tr>\n<td><strong>signature</strong></td>\n<td>String</td>\n<td>N</td>\n<td>signValue</td>\n</tr>\n</tbody>\n</table>\n</div><p>Server response parameters:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>code</td>\n<td>String</td>\n<td>Response Code (0 is success)</td>\n</tr>\n<tr>\n<td>message</td>\n<td>String</td>\n<td>Response Description</td>\n</tr>\n<tr>\n<td><strong>result</strong></td>\n<td>JSON</td>\n<td></td>\n</tr>\n<tr>\n<td>orderNo</td>\n<td>String</td>\n<td>Order Number</td>\n</tr>\n<tr>\n<td>tranCode</td>\n<td>String</td>\n<td>Transaction Code(820: AliPay Revoke/Refund, 809: Wechat Revoke/Refund)</td>\n</tr>\n<tr>\n<td>amount</td>\n<td>INT</td>\n<td>Transaction Amount in cents. For Example: $100 is 10000</td>\n</tr>\n<tr>\n<td>cnyAmount</td>\n<td>INT</td>\n<td>CNY Transaction Amount in cents. RMB Amount</td>\n</tr>\n<tr>\n<td>state</td>\n<td>INT</td>\n<td>Transaction State (1: Paying, 2: Paid, 3: Refund, 4: Closed(QR code expired), 5: Cancelled )Please be advised the partially refund state is 2: Paid. The fully refund state is 3: refund.</td>\n</tr>\n<tr>\n<td>payType</td>\n<td>String</td>\n<td>A: AliPay, W: WechatPay</td>\n</tr>\n<tr>\n<td>mnFlag</td>\n<td>String</td>\n<td>\"micro\"</td>\n</tr>\n<tr>\n<td>utcTimes</td>\n<td>String</td>\n<td>UTC Time</td>\n</tr>\n<tr>\n<td>exchangeRate</td>\n<td>Long</td>\n<td>Exchange Rate</td>\n</tr>\n<tr>\n<td>payTime</td>\n<td>String</td>\n<td>Transaction Time, GMT+8</td>\n</tr>\n<tr>\n<td>thirdTradeNo</td>\n<td>String</td>\n<td>Third Party Transaction Number (Transaction Number from AliPay or WechatPay)</td>\n</tr>\n<tr>\n<td>tranDesc</td>\n<td>String</td>\n<td>Transaction Description</td>\n</tr>\n</tbody>\n</table>\n</div><p>Sample of stringSignTemp for cancel function:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>orderno=01100100010000010201808300022&amp;trancode=813&amp;tranlogid=P100100010000010201808300025&amp;appid=5005642017008&amp;appsecret=cd3f5e88a1ec1df2351cdca75d7ce94a\n</code></pre><p>Sample of signValue generated by SHA1:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>43ab88146b14534d35f6ea40bc64a9cb9b408e67 \n</code></pre><p>Sample of merchant request：</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"param\": {\n        \"tranCode\": \"814\",\n        \"orderNo\": \"02100100010000010201901130010\",\n        \"tranLogId\": \"P100100010000010201901130008\"\n    },\n    \"suffix\": {\n        \"mid\": \"100100010000010\",\n        \"lang\": \"en\"\n       \n    },\n    \"signature\": \"{{cancelSignature}}\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["payment","pay","cancel"],"host":["api","motionpay","org"],"query":[],"variable":[]}},"response":[{"id":"0a1f53b3-6729-4f29-93e6-c6e881d885a0","name":"cancel","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"param\": {\n        \"tranCode\": \"814\",\n        \"orderNo\": \"02100100010000010201901130010\",\n        \"tranLogId\": \"P100100010000010201901130008\"\n    },\n    \"suffix\": {\n        \"mid\": \"100122220000005\",\n        \"lang\": \"en\"\n       \n    },\n    \"signature\": \"{{cancelSignature}}\"\n}"},"url":"https://api.motionpay.org/payment/pay/cancel"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sat, 12 Jan 2019 21:23:01 GMT"},{"key":"Content-Type","value":"application/json;charset=UTF-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"Apache-Coyote/1.1"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": \"0\",\n    \"message\": \"success\",\n    \"result\": {\n        \"orderNo\": \"02100100010000010201901130010\",\n        \"tranCode\": \"814\",\n        \"amount\": 1,\n        \"cnyAmount\": 0,\n        \"sn\": \"MyPosT00001\",\n        \"state\": 5,\n        \"payType\": \"W\",\n        \"mnFlag\": \"micro\",\n        \"refundAmount\": 0,\n        \"refundNo\": \"\",\n        \"utcTimes\": \"2019-01-13 04:12:51\",\n        \"exchangeRate\": 5.1444,\n        \"merchantOrderNo\": \"20190112151250\",\n        \"tranLogId\": \"P100100010000010201901130008\"\n    }\n}"}],"_postman_id":"c887b89b-7498-4cef-b9ed-4c45ea13e0bc"}],"event":[{"listen":"prerequest","script":{"id":"750d454c-a8dc-4e31-862a-e212aa15c7d1","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"9d191e30-c6c2-45b1-8ba8-eda7b9e2c245","type":"text/javascript","exec":[""]}}]}