{"info":{"_postman_id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","name":"payments","description":"<html><head></head><body><p>A collection of requests for <code>/payments</code> endpoint.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"13348269","collectionId":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","publishedId":"TzRa63yi","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-05-19T22:16:17.000Z"},"item":[{"name":"Get all payments","id":"ff8ab0f2-4a58-4f09-8bf2-33af52b18e2b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url}}/payments","description":"<h1 id=\"get-all-payments\">Get all payments</h1>\n<h2 id=\"response\">Response</h2>\n<hr />\n<p>List of payment details where each list item contains:</p>\n<ul>\n<li><code>payment_id</code></li>\n<li><code>amount</code></li>\n<li><code>payment_datetime</code></li>\n<li><code>payment_method</code></li>\n<li><code>movie</code> Item containing:<ul>\n<li><code>title</code></li>\n<li><code>poster_url</code></li>\n</ul>\n</li>\n</ul>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","name":"payments","type":"collection"}},"urlObject":{"path":["payments"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[{"id":"50cb39b8-12e8-4432-8820-fce1100c2bf5","name":"Mock Get All Payments","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/payments","host":["{{base_url}}"],"path":["payments"],"query":[{"key":"id","value":"1","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"502"},{"key":"ETag","value":"W/\"1f6-R/iVK8CCa22MARi1vyX8mXm3aO8\""},{"key":"Date","value":"Thu, 11 Mar 2021 12:59:32 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"headers\": {\n        \"success\": 1,\n        \"message\": \"Success\"\n    },\n    \"body\": [\n        {\n            \"payment_id\": 18,\n            \"amount\": 1400,\n            \"payment_datetime\": \"2021-03-20 06:30:00\",\n            \"payment_method\": \"card\",\n            \"user_id\": 2,\n            \"show_id\": 14\n        },\n        {\n            \"payment_id\": 19,\n            \"amount\": 1400,\n            \"payment_datetime\": \"2021-03-20 06:30:00\",\n            \"payment_method\": \"card\",\n            \"user_id\": 2,\n            \"show_id\": 18\n        },\n        {\n            \"payment_id\": 21,\n            \"amount\": 1400,\n            \"payment_datetime\": \"2021-03-20 06:33:00\",\n            \"payment_method\": \"card\",\n            \"user_id\": 1,\n            \"show_id\": 14\n        }\n    ]\n}"}],"_postman_id":"ff8ab0f2-4a58-4f09-8bf2-33af52b18e2b"},{"name":"Get Payment By Id","id":"41c45a8f-e566-431c-a2cf-135d6169fd66","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url}}/payments/id/27","description":"<h1 id=\"get-payment-by-id\">Get payment by id</h1>\n<h2 id=\"response\">Response</h2>\n<hr />\n<ul>\n<li><code>payment_id</code></li>\n<li><code>amount</code></li>\n<li><code>payment_datetime</code></li>\n<li><code>payment_method</code></li>\n<li><code>movie</code> Item containing:<ul>\n<li><code>title</code></li>\n<li><code>poster_url</code></li>\n</ul>\n</li>\n</ul>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","name":"payments","type":"collection"}},"urlObject":{"path":["payments","id","27"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[{"id":"12f4d1e8-d040-4553-9a62-62d3cdaa92b4","name":"Mock Get Payment By Id","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/payments","host":["{{base_url}}"],"path":["payments"],"query":[{"key":"id","value":"1","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"502"},{"key":"ETag","value":"W/\"1f6-R/iVK8CCa22MARi1vyX8mXm3aO8\""},{"key":"Date","value":"Thu, 11 Mar 2021 12:59:32 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"headers\": {\n        \"success\": 1,\n        \"message\": \"Success\"\n    },\n    \"body\": {\n        \"payment_id\": 18,\n        \"amount\": 1400,\n        \"payment_datetime\": \"2021-03-20 06:30:00\",\n        \"payment_method\": \"card\",\n        \"movie\": {\n            \"title\": \"GOOGLE\",\n            \"poster_url\": \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSpMwciKW5gytHux-4a4B7e50sQCyvnix9C57mAGnY0DNX4-uGQ\"\n        }\n    }\n}"}],"_postman_id":"41c45a8f-e566-431c-a2cf-135d6169fd66"},{"name":"Get User Payments","id":"a0dc43ef-65ad-4865-b19a-adc35a001ec4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url}}/payments/users/10","description":"<h1 id=\"get-all-payments-of-a-user\">Get all payments of a user</h1>\n<h2 id=\"response\">Response</h2>\n<hr />\n<p>List of payment details where each list item contains:</p>\n<ul>\n<li><code>payment_id</code></li>\n<li><code>amount</code></li>\n<li><code>payment_datetime</code></li>\n<li><code>payment_method</code></li>\n<li><code>movie</code> Item containing:<ul>\n<li><code>title</code></li>\n<li><code>poster_url</code></li>\n</ul>\n</li>\n</ul>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","name":"payments","type":"collection"}},"urlObject":{"path":["payments","users","10"],"host":["{{base_url}}"],"query":[{"disabled":true,"key":"id","value":"1"}],"variable":[]}},"response":[{"id":"733ee353-6965-43b3-9583-fab5548a6cc0","name":"Mock Get User Payments","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/payments/users/2","host":["{{base_url}}"],"path":["payments","users","2"],"query":[{"key":"id","value":"1","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"502"},{"key":"ETag","value":"W/\"1f6-R/iVK8CCa22MARi1vyX8mXm3aO8\""},{"key":"Date","value":"Thu, 11 Mar 2021 12:59:32 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"headers\": {\n        \"success\": 1,\n        \"message\": \"Success\"\n    },\n    \"body\": [\n        {\n            \"payment_id\": 18,\n            \"amount\": 1400,\n            \"payment_datetime\": \"2021-03-20 06:30:00\",\n            \"payment_method\": \"card\",\n            \"movie\": {\n                \"title\": \"GOOGLE\",\n                \"poster_url\": \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSpMwciKW5gytHux-4a4B7e50sQCyvnix9C57mAGnY0DNX4-uGQ\"\n            }\n        },\n        {\n            \"payment_id\": 19,\n            \"amount\": 1400,\n            \"payment_datetime\": \"2021-03-20 06:30:00\",\n            \"payment_method\": \"card\",\n            \"movie\": {\n                \"title\": \"FACEBOOK\",\n                \"poster_url\": \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSpMwciKW5gytHux-4a4B7e50sQCyvnix9C57mAGnY0DNX4-uGQ\"\n            }\n        }\n    ]\n}"}],"_postman_id":"a0dc43ef-65ad-4865-b19a-adc35a001ec4"},{"name":"Add a payment","id":"cccedc64-bf61-413b-977a-3b05fe99bfe3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"amount\":1400,\r\n    \"payment_datetime\":\"2021-03-20 06:33:00\",\r\n    \"payment_method\":\"card\",\r\n    \"user_id\":10,\r\n    \"show_id\":23,\r\n    \"bookings\":[157,158,159]\r\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/payments/","description":"<h1 id=\"add-a-new-payment\">Add a new payment</h1>\n<hr />\n<p>These parameters have special rules:</p>\n<h3 id=\"payment-method\">Payment Method</h3>\n<p><code>payment_method</code> can take one of two values:</p>\n<ul>\n<li><code>cash</code> for on hand cash payments.</li>\n<li><code>card</code> for online/on-hand card payments.</li>\n<li><code>cod</code> for cash payments at time of delivery.</li>\n</ul>\n<h3 id=\"bookings\">Bookings</h3>\n<ul>\n<li>Be a list.</li>\n<li>Each item should be an int.</li>\n<li>Each item should be a valid <code>booking_id</code>.</li>\n</ul>\n<h3 id=\"payment-datetime\">Payment Datetime</h3>\n<ul>\n<li>Be a string.</li>\n<li>Have the format \"yyyy-mm-dd hh:mm:ss\"</li>\n</ul>\n<hr />\n<h2 id=\"response\">Response</h2>\n<hr />\n<ul>\n<li><code>payment_id</code> New theater's id.</li>\n<li><code>affected_rows</code> Should be 1.</li>\n</ul>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","name":"payments","type":"collection"}},"urlObject":{"path":["payments",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[{"id":"86ac9755-9dd2-4fcf-9cfb-cf2ae7da05c7","name":"Mock Add a payment","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"amount\":1400,\r\n    \"payment_datetime\":\"2021-03-20 06:33:00\",\r\n    \"payment_method\":\"card\",\r\n    \"user_id\":2,\r\n    \"show_id\":14,\r\n    \"bookings\":[2,3]\r\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/payments/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"100"},{"key":"ETag","value":"W/\"64-NJV6W7StBkEjto3MWYPH7Dt+/ZQ\""},{"key":"Date","value":"Thu, 11 Mar 2021 12:09:28 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"headers\": {\n        \"success\": 1,\n        \"message\": \"Payment was created! Booking was confirmed!\"\n    },\n    \"body\": {\n        \"payment_id\": 7,\n        \"affected_rows\": 1\n    }\n}"}],"_postman_id":"cccedc64-bf61-413b-977a-3b05fe99bfe3"},{"name":"Update a payment","id":"8de75b42-46a4-4971-beaa-1c8c170a1779","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"amount\":700\r\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/payments/id/6","description":"<h1 id=\"update-payment-details\">Update payment details</h1>\n<h2 id=\"response\">Response</h2>\n<hr />\n<ul>\n<li>None</li></ul>\n\n<p><em><strong>Note</strong></em> : <code>message</code> header indicates result.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","name":"payments","type":"collection"}},"urlObject":{"path":["payments","id","6"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[{"id":"b995eb2a-78fb-4803-8a41-978688da9807","name":"Mock Update a payment","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"amount\":5000\r\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/payments/id/6"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"116"},{"key":"ETag","value":"W/\"74-9rUnRxnq0oMgF9qxowgAwUyaXws\""},{"key":"Date","value":"Thu, 11 Mar 2021 12:10:03 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"headers\": {\n        \"success\": 1,\n        \"message\": \"Payment updated successfully\"\n    },\n    \"body\": \"Rows matched: 1  Changed: 1  Warnings: 0\"\n}"}],"_postman_id":"8de75b42-46a4-4971-beaa-1c8c170a1779"},{"name":"Delete a payment","id":"651a2eae-c2a1-4782-9b17-9ceec238cef1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{base_url}}/payments/id/5","description":"<h1 id=\"delete-a-payment\">Delete a payment</h1>\n<h2 id=\"response\">Response</h2>\n<hr />\n<ul>\n<li>None</li></ul>\n\n<p><em><strong>Note</strong></em> : <code>message</code> header indicates result.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]},"isInherited":true,"source":{"_postman_id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","id":"b29e55ce-6c77-4a72-865f-f16e55f2a41e","name":"payments","type":"collection"}},"urlObject":{"path":["payments","id","5"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[{"id":"0098725b-6a5f-4a17-abdc-d50dc73c8dec","name":"Mock Delete a booking","originalRequest":{"method":"DELETE","header":[],"url":"{{base_url}}/payments/id/7"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"72"},{"key":"ETag","value":"W/\"48-3pw1qSyBLqkQfmvuK0DO0EjjLAw\""},{"key":"Date","value":"Thu, 11 Mar 2021 12:10:51 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"headers\": {\n        \"success\": 1,\n        \"message\": \"Payment has been deleted\"\n    },\n    \"body\": {}\n}"}],"_postman_id":"651a2eae-c2a1-4782-9b17-9ceec238cef1"}],"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{token}}"}]}},"event":[{"listen":"prerequest","script":{"id":"b73eaa1c-9e93-4f39-b16d-38f238a9eca8","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"f4d9e852-92c2-4846-90da-bcee5e2a9533","type":"text/javascript","exec":[""]}}]}