{"id":98,"date":"2024-11-25T02:15:50","date_gmt":"2024-11-25T02:15:50","guid":{"rendered":"https:\/\/tolipsanaa.com\/?p=98"},"modified":"2024-11-25T03:12:50","modified_gmt":"2024-11-25T03:12:50","slug":"a","status":"publish","type":"post","link":"https:\/\/tolipsanaa.com\/index.php\/2024\/11\/25\/a\/","title":{"rendered":"a"},"content":{"rendered":"\n<header>\n        <h1>Jaib Pay API<\/h1>\n    <\/header>\n    <div class=\"container\">\n        <div class=\"endpoint\">\n            <h2>LoginWebAPI<\/h2>\n            <label for=\"login-username\">User Name:<\/label>\n            <input type=\"text\" id=\"login-username\" value=\"hazmi3\">\n            <label for=\"login-password\">Password:<\/label>\n            <input type=\"\" id=\"login-password\" value=\"12345a\">\n            <label for=\"login-agentCode\">Agent Code:<\/label>\n            <input type=\"text\" id=\"login-agentCode\" value=\"10004\">\n            <button onclick=\"loginWebAPI()\">Submit<\/button>\n            <h3>Response:<\/h3>\n            <pre id=\"login-response\"><\/pre>\n        <\/div>\n        <div class=\"endpoint\">\n            <h2>ExecuteBuyOnlineByCode<\/h2>\n            <label for=\"pinApi\">Pin API:<\/label>\n            <input type=\"text\" id=\"pinApi\" value=\"\">\n            <label for=\"requestID\">Request ID:<\/label>\n            <input type=\"text\" id=\"requestID\" value=\"100000210023\">\n            <label for=\"code\">Code:<\/label>\n            <input type=\"text\" id=\"code\" value=\"3719\">\n            <label for=\"amount\">Amount:<\/label>\n            <input type=\"number\" id=\"amount\" value=\"5000\">\n            <label for=\"currencyCode\">Currency Code:<\/label>\n            <input type=\"text\" id=\"currencyCode\" value=\"YER\">\n            <label for=\"mobile\">Mobile:<\/label>\n            <input type=\"text\" id=\"mobile\" value=\"774760761\">\n            <label for=\"notes\">Notes:<\/label>\n            <textarea id=\"notes\"><\/textarea>\n            <button onclick=\"executeBuyOnlineByCode()\">Submit<\/button>\n            <h3>Response:<\/h3>\n            <pre id=\"buy-response\"><\/pre>\n        <\/div>\n    <\/div>\n    <script>\n        const baseUrl = \"{{url}}\";\n\n        async function loginWebAPI() {\n            const url = `https:\/\/www.api2.e-jaib.com:5088\/api\/v1\/TokenAuth\/LogAPI`;\n            const body = JSON.stringify({\n                userName: document.getElementById(\"login-username\").value,\n                \/\/userName:'hazmi3',\n\t\t\t\t\n                password: document.getElementById(\"login-password\").value,\n\t\t\t\t\/\/password:'12345a',\n                agentCode: document.getElementById(\"login-agentCode\").value\n               \/\/agentCode:'10004'\n            });\n\n            try {\n                const response = await fetch(url, {\n                    method: \"POST\",\n                    headers: { \"Content-Type\": \"application\/json; charset=utf-8\" },\n                    body: body\n                });\n                const data = await response.json();\n                document.getElementById(\"login-response\").textContent = JSON.stringify(data, null, 4);\n\n                if (data.result) {\n                    document.getElementById(\"pinApi\").value = data.result.pinApi;\n                }\n            } catch (error) {\n                document.getElementById(\"login-response\").textContent = error;\n            }\n        }\n\n        async function executeBuyOnlineByCode() {\n            const url = `https:\/\/www.api2.e-jaib.com:5088\/api\/v1\/BuyOnline\/ExeBuy`;\n            const body = JSON.stringify({\n                pinApi: document.getElementById(\"pinApi\").value,\n                requestID: document.getElementById(\"requestID\").value,\n                code: document.getElementById(\"code\").value,\n                amount: parseInt(document.getElementById(\"amount\").value),\n                currencyCode: document.getElementById(\"currencyCode\").value,\n                mobile: document.getElementById(\"mobile\").value,\n                notes: document.getElementById(\"notes\").value\n            });\n\n            try {\n                const response = await fetch(url, {\n                    method: \"POST\",\n                    headers: {\n                        \"Content-Type\": \"application\/json\",\n                        \"Auth\": document.getElementById(\"pinApi\").value\n                    },\n                    body: body\n                });\n                const data = await response.json();\n                document.getElementById(\"buy-response\").textContent = JSON.stringify(data, null, 4);\n            } catch (error) {\n                document.getElementById(\"buy-response\").textContent = error;\n            }\n        }\n    <\/script>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jaib Pay API LoginWebAPI User Name: Password: Agent Code: Submit Response: ExecuteBuyOnlineByCode Pin API: Request ID: Code: Amount: Currency Code: Mobile: Notes: Submit Response:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-98","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/tolipsanaa.com\/index.php\/wp-json\/wp\/v2\/posts\/98","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tolipsanaa.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tolipsanaa.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tolipsanaa.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tolipsanaa.com\/index.php\/wp-json\/wp\/v2\/comments?post=98"}],"version-history":[{"count":22,"href":"https:\/\/tolipsanaa.com\/index.php\/wp-json\/wp\/v2\/posts\/98\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/tolipsanaa.com\/index.php\/wp-json\/wp\/v2\/posts\/98\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/tolipsanaa.com\/index.php\/wp-json\/wp\/v2\/media?parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tolipsanaa.com\/index.php\/wp-json\/wp\/v2\/categories?post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tolipsanaa.com\/index.php\/wp-json\/wp\/v2\/tags?post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}