{"info":{"_postman_id":"fa74c227-4129-462f-a7a8-77336c88b839","name":"Check-Slip","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"16901777","collectionId":"fa74c227-4129-462f-a7a8-77336c88b839","publishedId":"UzBiPUFz","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-06-17T04:41:07.000Z"},"item":[{"name":"REST API","item":[{"name":"Authentication","id":"e99c3cde-be87-45a1-ba44-5627e9060445","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"email","value":"<your_email>","description":"<p>Your login email</p>\n","type":"text"},{"key":"password","value":"<your_password>","description":"<p>Your login password</p>\n","type":"text"}]},"url":"https://check-slip.com/api/login","urlObject":{"protocol":"https","path":["api","login"],"host":["check-slip","com"],"query":[],"variable":[]}},"response":[{"id":"a0868362-8fef-4860-8ae3-c1c95b148916","name":"Authentication","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"email","value":"<your_email>","type":"text"},{"key":"password","value":"<your_password>","type":"text"}]},"url":"https://check-slip.com/api/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"user\": {\n        \"id\": 2,\n        \"name\": \"<your_username>\",\n        \"email\": \"<your_email>\",\n        \"email_verified_at\": null,\n        \"merchant_id\": null,\n        \"created_at\": \"2022-06-15T08:53:41.000000Z\",\n        \"updated_at\": \"2022-06-15T08:53:41.000000Z\",\n        \"deleted_at\": null\n    },\n    \"access_token\": \"<your_token>\"\n}"}],"_postman_id":"e99c3cde-be87-45a1-ba44-5627e9060445"},{"name":"Verify","id":"c4324f85-8f0e-4387-b50b-e526d869904a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"warning":"This is a duplicate header and will be overridden by the Content-Type header generated by Postman.","key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"merchantCode","value":"<your_merchant_code>","description":"<p>Merchant code from configuration page</p>\n","type":"text"},{"key":"orderId","value":"<your_order_id>","description":"<p>Order Id in your system</p>\n","type":"text"},{"key":"paymentSlip","description":"<p>Payment Slip Image base64 endcode format jpeg,png,jpg maximum to 2 MB</p>\n","type":"text","value":"data:image/png;base64,<content>"},{"key":"amount","value":"<amount>","description":"<p>Amount of your order</p>\n","type":"text"},{"key":"orderDate","value":"<order_date>","description":"<p>Order create date format Y-m-d H:i:s</p>\n","type":"text"}]},"url":"https://check-slip.com/api/verify","urlObject":{"protocol":"https","path":["api","verify"],"host":["check-slip","com"],"query":[],"variable":[]}},"response":[{"id":"735ca222-2db2-4271-9bae-3deacaf2413f","name":"Verify","originalRequest":{"method":"POST","header":[{"warning":"This is a duplicate header and will be overridden by the Content-Type header generated by Postman.","key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"merchantCode","value":"<your_merchant_code>","description":"Merchant code from configuration page","type":"text"},{"key":"orderId","value":"<your_order_id>","description":"Order Id in your system","type":"text"},{"key":"paymentSlip","description":"Payment Slip Image base64 endcode format jpeg,png,jpg maximum to 2 MB","type":"text","value":""},{"key":"amount","value":"<amount>","description":"Amount of your order","type":"text"},{"key":"orderDate","value":"<order_date>","description":"Order create date","type":"text"}]},"url":"https://check-slip.com/api/verify"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"c4324f85-8f0e-4387-b50b-e526d869904a"},{"name":"QuickVerify","id":"6bb69fa9-817b-467c-8747-7135987e0e8a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"warning":"This is a duplicate header and will be overridden by the Content-Type header generated by Postman.","key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"merchantCode","value":"merchantCode","description":"<p>Merchant code from configuration page</p>\n","type":"text"},{"key":"orderId","value":"{{timestamp}}","description":"<p>Order Id in your system</p>\n","type":"text"}]},"url":"https://check-slip.com/api/quickVerify","urlObject":{"protocol":"https","path":["api","quickVerify"],"host":["check-slip","com"],"query":[],"variable":[]}},"response":[{"id":"5af6e6c2-1e04-498e-a51b-ba1d4356ae77","name":"Verify","originalRequest":{"method":"POST","header":[{"warning":"This is a duplicate header and will be overridden by the Content-Type header generated by Postman.","key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"merchantCode","value":"<your_merchant_code>","type":"text"},{"key":"orderId","value":"<your_order_id>","type":"text"},{"key":"paymentSlip","type":"file","src":[]},{"key":"amount","value":"<amount>","type":"text"}]},"url":"https://check-slip.com/api/verify"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Host","value":"localhost:8000"},{"key":"Date","value":"Wed, 15 Jun 2022 08:48:07 GMT"},{"key":"Date","value":"Wed, 15 Jun 2022 08:48:07 GMT"},{"key":"Connection","value":"close"},{"key":"X-Powered-By","value":"PHP/7.4.22"},{"key":"Cache-Control","value":"no-cache, private"},{"key":"Content-Type","value":"application/json"},{"key":"X-RateLimit-Limit","value":"60"},{"key":"X-RateLimit-Remaining","value":"57"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 7,\n        \"merchant_id\": 11,\n        \"order_id\": null,\n        \"status\": \"pending\",\n        \"message\": \"รอตรวจสอบ\",\n        \"payment_slip\": \"1655282886.png\",\n        \"order_date\": null,\n        \"transactions_ref_id\": null,\n        \"amount\": 100,\n        \"mini_QR\": null,\n        \"merchant_bank_id\": null,\n        \"sender_name\": null,\n        \"sender_bank\": null,\n        \"sender_account_number\": null,\n        \"reciever_name\": null,\n        \"reciever_bank\": null,\n        \"reciever_account_number\": null,\n        \"transfer_amount\": null,\n        \"diff_amount\": null,\n        \"remark\": null,\n        \"transfered_at\": null,\n        \"content\": null,\n        \"response\": null,\n        \"attemps\": 0,\n        \"return_status\": \"initial\",\n        \"next_push_time\": null,\n        \"created_at\": \"2022-06-15T08:48:07.000000Z\",\n        \"updated_at\": \"2022-06-15T08:48:07.000000Z\",\n        \"deleted_at\": null\n    },\n    \"message\": \"Create Verification success\"\n}"}],"_postman_id":"6bb69fa9-817b-467c-8747-7135987e0e8a"},{"name":"Bank Master","id":"8156fb39-fce3-4557-a20c-1eb228851220","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[{"warning":"This is a duplicate header and will be overridden by the Content-Type header generated by Postman.","key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"url":"https://check-slip.com/api/banks","urlObject":{"protocol":"https","path":["api","banks"],"host":["check-slip","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"8156fb39-fce3-4557-a20c-1eb228851220"},{"name":"Credit Balance","id":"81ab6dcd-4cad-454e-8d3c-ce5f1f457b70","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[{"warning":"This is a duplicate header and will be overridden by the Content-Type header generated by Postman.","key":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"url":"https://check-slip.com/api/creditBalance","urlObject":{"protocol":"https","path":["api","creditBalance"],"host":["check-slip","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"81ab6dcd-4cad-454e-8d3c-ce5f1f457b70"}],"id":"e363a7a7-e91c-4134-95ce-e8187bcf6a9b","_postman_id":"e363a7a7-e91c-4134-95ce-e8187bcf6a9b","description":""},{"name":"Webhook","item":[{"name":"Update Verification","id":"2818c1b1-a84e-4235-974b-7ec82aa1fb19","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-CL-APIKEY","value":"<your_api_key>","type":"text"},{"key":"X-CL-SIGN","value":"<signature>","type":"text"},{"key":"X-CL-TIMESTAMP","value":"<timestamp>","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"orderId","value":"Order ID","description":"<p>Merchant Order ID</p>\n","type":"text"},{"key":"status","value":"Status","description":"<p>pending = waiting for verify <br /> approve = verify success <br /> reject = slip data not match with your data</p>\n","type":"text"},{"key":"message","value":"Message","description":"<p>Status Message</p>\n","type":"text"},{"key":"amount","value":"Amount","description":"<p>Amount of your order</p>\n","type":"text"},{"key":"merchantBank","value":"Merchant Bank","description":"<p>Merchant Bank is match between sender bank with bank in configuration</p>\n","type":"text"},{"key":"transferAmount","value":"Transfer Amount","description":"<p>Transfer Amount in Order Slip</p>\n","type":"text"},{"key":"diffAmount","value":"Difference Amount","description":"<p>Difference Amount between amount and transfer amount</p>\n","type":"text"},{"key":"transferedAt","value":"Transfered At","description":"<p>Transfer time</p>\n","type":"text"},{"key":"remark","value":"Remark","description":"<p>Verification remark</p>\n","type":"text"}]},"url":"<your_webhook_url>","description":"<h3>Verify Signatures</h3>\n\n<h4>Build the payload</h4>\n\n<p><code>$payload = $timestamp . \"\\n\" .json_encode($body) . \"\\n\";</code></p>\n<h4>Hash Signatures</h4>\n\n<p><code>$signature = hash_hmac(\"SHA256\", $payload, $api_secret);</code></p>\n","urlObject":{"host":["<your_webhook_url>"],"query":[],"variable":[]}},"response":[{"id":"463b41f5-fdff-4a3e-a68b-4e596736f249","name":"Update Verification","originalRequest":{"method":"POST","header":[{"key":"X-CL-APIKEY","value":"<your_api_key>","type":"text"},{"key":"X-CL-SIGN","value":"<signature>","type":"text"},{"key":"X-CL-TIMESTAMP","value":"<timestamp>","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"orderId","value":"Order ID","description":"Merchant Order ID","type":"text"},{"key":"status","value":"Status","description":"pending = waiting for verify <br> approve = verify success <br> reject = slip data not match with your data","type":"text"},{"key":"message","value":"Message","description":"Status Message","type":"text"},{"key":"amount","value":"Amount","description":"Amount of your order","type":"text"},{"key":"merchantBank","value":"Merchant Bank","description":"Merchant Bank is match between sender bank with bank in configuration","type":"text"},{"key":"transferAmount","value":"Transfer Amount","description":"Transfer Amount in Order Slip","type":"text"},{"key":"diffAmount","value":"Difference Amount","description":"Difference Amount between amount and transfer amount","type":"text"},{"key":"transferedAt","value":"Transfered At","description":"Transfer time","type":"text"},{"key":"remark","value":"Remark","description":"Verification remark","type":"text"}],"options":{"raw":{"language":"json"}}},"url":"<your_webhook_url>"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"returnCode\": \"SUCCESS\",\n    \"returnMessage\": null\n}"}],"_postman_id":"2818c1b1-a84e-4235-974b-7ec82aa1fb19"}],"id":"798e6958-c2cb-481b-ac97-34731a794bbf","_postman_id":"798e6958-c2cb-481b-ac97-34731a794bbf","description":""}],"event":[{"listen":"prerequest","script":{"id":"4393bb1a-8364-4ca5-aeaf-d953baca5db8","type":"text/javascript","exec":["const ts  = Date.now();","pm.environment.set(\"timestamp\", ts);","","let paramsObject = {};","","const slv_api_secret = pm.environment.get(\"slv-api-secret\");","","const parameters = pm.request.url.query;","","parameters.map((param) => {","    if (param.key != 'signature' && ","        param.key != 'timestamp' && ","        !is_empty(param.value) &&","        !is_disabled(param.disabled)) {","            paramsObject[param.key] = param.value;","            //console.log(encodeURIComponent(param.value));","            //pm.environment.set(param.key, encodeURIComponent(param.value));","    }","})","        ","Object.assign(paramsObject, {'timestamp': ts});","","if (slv_api_secret) {","    const queryString = Object.keys(paramsObject).map((key) => {","        return `${key}=${paramsObject[key]}`;","    }).join('&');","    console.log(queryString);","    const signature = CryptoJS.HmacSHA256(queryString, slv_api_secret).toString();","    pm.environment.set(\"signature\", signature);","}","","","function is_disabled(str) {","    return str == true;","}","","function is_empty(str) {","    if (typeof str == 'undefined' ||","        !str || ","        str.length === 0 || ","        str === \"\" ||","        !/[^\\s]/.test(str) ||","        /^\\s*$/.test(str) ||","        str.replace(/\\s/g,\"\") === \"\")","    {","        return true;","    }","    else","    {","        return false;","    }","}"]}},{"listen":"test","script":{"id":"d6b7cd4e-4a37-4a02-9b7b-c8b2183ffdcf","type":"text/javascript","exec":[""]}}]}