{"info":{"_postman_id":"cbf0444a-8d6c-4bbf-8f18-cba8b1a964a1","name":"Online Payment API","description":"<html><head></head><body><p>This is an API for a donations system, comprising of endpoints to initialize a transaction and verify payments from transactions.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"17383417","collectionId":"cbf0444a-8d6c-4bbf-8f18-cba8b1a964a1","publishedId":"2s93RXtqr5","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2023-04-05T21:01:27.000Z"},"item":[{"name":"Initialize Payment","id":"ab594700-6584-4726-a70e-487690fb74cc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"johndoe@example.com\",\n    \"name\": \"John Doe\",\n    \"amount\": 1500000,\n    \"callbackUrl\": \"http://localhost:5000/api/paystack/verify\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/paystack/initialize","description":"<p>This is a <strong>POST</strong> endpoint that is used to generate an <em>authorization url or checkout link</em> to direct donors to complete transaction on Paystack.</p>\n<h4 id=\"required-fields\">Required fields:</h4>\n<ul>\n<li>email: email of the donor.</li>\n<li>name: fullname of the donor.</li>\n<li>amount: amount being donated in kobo.</li>\n</ul>\n<h4 id=\"optional-fields\"><strong>Optional fields</strong>:</h4>\n<ul>\n<li>callbackUrl: overides the paystack webhook endpoint, where paystack sends the response from checkout to.</li>\n</ul>\n<h3 id=\"response-data\"><strong>Response Data</strong></h3>\n<p><strong>authorizationUrl</strong>: paystach checkout url. Which users would be directed to complete payment by providing card/account details.</p>\n<p><strong>accessCode</strong>: checkout payment access code</p>\n<p><strong>reference</strong>: unique payment reference that identifies each transaction on Paystack.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","paystack","initialize"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"76c88107-1690-402f-83a7-e5786feac10a","name":"New Request","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"johndoe@example.com\",\n    \"name\": \"John Doe\",\n    \"amount\": 1000000,\n    \"callbackUrl\": \"http://localhost:5000/api/paystack/verify\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/paystack/initialize"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"X-XSS-Protection","value":"0"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"178"},{"key":"ETag","value":"W/\"b2-lIh//uc84eqxDOZBtjbLGuGEPlc\""},{"key":"Date","value":"Tue, 04 Apr 2023 14:52:13 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Payment initialized successfully\",\n    \"data\": {\n        \"authorizationUrl\": \"https://checkout.paystack.com/u7hdwxjor1wu1h0\",\n        \"accessCode\": \"u7hdwxjor1wu1h0\",\n        \"reference\": \"2n2lewqec4\"\n    }\n}"}],"_postman_id":"ab594700-6584-4726-a70e-487690fb74cc"},{"name":"Verify Payment","id":"ea96d524-4ce7-41ac-871f-6f227973d244","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/paystack/verify?reference=0uyuzbuij5","description":"<p>This is a GET endpoint for transaction verification using payment reference from paystack. Payment references are unique identifiers from paystack for every transaction to a merchant.</p>\n<p>This endpoint expects the reference to be passed as a <em><strong>query string with key: 'reference'.</strong></em></p>\n<blockquote>\n<p>localhost:5000/api/paystack/verify?reference=&lt;paymentReference&gt; </p>\n</blockquote>\n<h3 id=\"response-data\"><strong>Response Data</strong></h3>\n<p><strong>id:</strong> number</p>\n<p><strong>name:</strong> string <strong>-&gt;</strong> <em>fullname of donor</em></p>\n<p><strong>email:</strong> string <strong>-&gt;</strong> <em>email of donor</em></p>\n<p><strong>amount:</strong> number <strong>-&gt;</strong> <em>amount donated</em></p>\n<p><strong>paymentReference:</strong> string <strong>-&gt;</strong> <em>unique payment reference from paystack</em></p>\n<p><strong>createdAt:</strong> string</p>\n<p><strong>updatedAt:</strong> string</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","paystack","verify"],"host":["localhost"],"query":[{"key":"reference","value":"0uyuzbuij5"}],"variable":[]}},"response":[{"id":"9d9563ac-8436-403c-af65-e1cdb78a7157","name":"Verify Payment","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:5000/api/paystack/verify?reference=0uyuzbuij5","protocol":"http","host":["localhost"],"port":"5000","path":["api","paystack","verify"],"query":[{"key":"reference","value":"0uyuzbuij5"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"X-XSS-Protection","value":"0"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"226"},{"key":"ETag","value":"W/\"e2-bBj3w4WKqJaFku1Uly97hZsYe8M\""},{"key":"Date","value":"Wed, 05 Apr 2023 17:55:36 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Payment verified\",\n    \"data\": {\n        \"id\": 2,\n        \"name\": \"Allen Fred\",\n        \"email\": \"allenfred@ubagroup.com\",\n        \"amount\": 3200000,\n        \"paymentReference\": \"0uyuzbuij5\",\n        \"createdAt\": \"2023-03-30T12:35:58.528Z\",\n        \"updatedAt\": \"2023-03-30T12:35:58.528Z\"\n    }\n}"}],"_postman_id":"ea96d524-4ce7-41ac-871f-6f227973d244"},{"name":"New Request","id":"dc19463a-2763-42e7-be98-ff29b23a2776","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000","urlObject":{"protocol":"http","port":"5000","host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"dc19463a-2763-42e7-be98-ff29b23a2776"}]}