Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

ci(postman): log request id for user tests (#5159)

Apoorv Dixit61d31dc44494
diff --git a/postman/collection-dir/users/Flow Testcases/Sign In/Signin Token Only Wrong/event.test.js b/postman/collection-dir/users/Flow Testcases/Sign In/Signin Token Only Wrong/event.test.js
index 16fca64a14..a929753845 100644
--- a/postman/collection-dir/users/Flow Testcases/Sign In/Signin Token Only Wrong/event.test.js
+++ b/postman/collection-dir/users/Flow Testcases/Sign In/Signin Token Only Wrong/event.test.js
@@ -1,3 +1,5 @@
+console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
+
// Validate status 4xx
pm.test("[POST]::/user/v2/signin?token_only=true - Status code is 401", function () {
pm.response.to.have.status(401);
diff --git a/postman/collection-dir/users/Flow Testcases/Sign In/Signin Token Only/event.test.js b/postman/collection-dir/users/Flow Testcases/Sign In/Signin Token Only/event.test.js
index a8b3658e5f..9105ce122c 100644
--- a/postman/collection-dir/users/Flow Testcases/Sign In/Signin Token Only/event.test.js
+++ b/postman/collection-dir/users/Flow Testcases/Sign In/Signin Token Only/event.test.js
@@ -1,3 +1,5 @@
+console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
+
// Validate status 2xx
pm.test("[POST]::user/v2/signin?token_only=true - Status code is 2xx", function () {
pm.response.to.be.success;
diff --git a/postman/collection-dir/users/Flow Testcases/Sign In/Signin Wrong/event.test.js b/postman/collection-dir/users/Flow Testcases/Sign In/Signin Wrong/event.test.js
index e0149290da..6cb6b69ba6 100644
--- a/postman/collection-dir/users/Flow Testcases/Sign In/Signin Wrong/event.test.js
+++ b/postman/collection-dir/users/Flow Testcases/Sign In/Signin Wrong/event.test.js
@@ -1,3 +1,5 @@
+console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
+
// Validate status code is 4xx Bad Request
pm.test("[POST]::/user/v2/signin - Status code is 401", function () {
pm.response.to.have.status(401);
diff --git a/postman/collection-dir/users/Flow Testcases/Sign In/Signin/event.test.js b/postman/collection-dir/users/Flow Testcases/Sign In/Signin/event.test.js
index 174cbd8e5e..4724ff5981 100644
--- a/postman/collection-dir/users/Flow Testcases/Sign In/Signin/event.test.js
+++ b/postman/collection-dir/users/Flow Testcases/Sign In/Signin/event.test.js
@@ -1,3 +1,5 @@
+console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
+
// Validate status 2xx
pm.test("[POST]::/user/v2/signin - Status code is 2xx", function () {
pm.response.to.be.success;
diff --git a/postman/collection-dir/users/Flow Testcases/Sign Up/Connect Account/event.test.js b/postman/collection-dir/users/Flow Testcases/Sign Up/Connect Account/event.test.js
index 6dbed06b0f..0c6426d4cf 100644
--- a/postman/collection-dir/users/Flow Testcases/Sign Up/Connect Account/event.test.js
+++ b/postman/collection-dir/users/Flow Testcases/Sign Up/Connect Account/event.test.js
@@ -1,3 +1,5 @@
+console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
+
// Validate status 2xx
pm.test("[POST]::/user/connect_account - Status code is 2xx", function () {
pm.response.to.be.success;
@@ -21,3 +23,4 @@ pm.test("[POST]::/user/connect_account - Response contains is_email_sent", funct
pm.expect(jsonData).to.have.property("is_email_sent");
pm.expect(jsonData.is_email_sent).to.be.true;
});
+
diff --git a/postman/collection-json/users.postman_collection.json b/postman/collection-json/users.postman_collection.json
index 943d37d22d..d6067fd668 100644
--- a/postman/collection-json/users.postman_collection.json
+++ b/postman/collection-json/users.postman_collection.json
@@ -1,556 +1,567 @@
{
- "event": [
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "test",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "item": [
- {
- "name": "Health check",
- "item": [
- {
- "name": "New Request",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "// Validate status 2xx",
- "pm.test(\"[POST]::/health - Status code is 2xx\", function () {",
- " pm.response.to.be.success;",
- "});",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "{{baseUrl}}/health",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "health"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "Flow Testcases",
- "item": [
- {
- "name": "Sign Up",
- "item": [
- {
- "name": "Connect Account",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "// Validate status 2xx",
- "pm.test(\"[POST]::/user/connect_account - Status code is 2xx\", function () {",
- " pm.response.to.be.success;",
- "});",
- "",
- "// Validate if response header has matching content-type",
- "pm.test(\"[POST]::/user/connect_account - Content-Type is application/json\", function () {",
- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
- " \"application/json\",",
- " );",
- "});",
- "",
- "// Validate if response has JSON Body",
- "pm.test(\"[POST]::/user/connect_account - Response has JSON Body\", function () {",
- " pm.response.to.have.jsonBody();",
- "});",
- "",
- "// Validate specific JSON response content",
- "pm.test(\"[POST]::/user/connect_account - Response contains is_email_sent\", function () {",
- " var jsonData = pm.response.json();",
- " pm.expect(jsonData).to.have.property(\"is_email_sent\");",
- " pm.expect(jsonData.is_email_sent).to.be.true;",
- "});",
- ""
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- "",
- "var baseEmail = pm.environment.get('user_base_email_for_signup');",
- "var emailDomain = pm.environment.get(\"user_domain_for_signup\");",
- "",
- "// Generate a unique email address",
- "var uniqueEmail = baseEmail + new Date().getTime() + emailDomain;",
- "// Set the unique email address as an environment variable",
- "pm.environment.set('unique_email', uniqueEmail);",
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "Cookie",
- "value": "Cookie_1=value"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\"email\":\"{{unique_email}}\"}"
- },
- "url": {
- "raw": "{{baseUrl}}/user/connect_account",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "user",
- "connect_account"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "Sign In",
- "item": [
- {
- "name": "Signin",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "// Validate status 2xx",
- "pm.test(\"[POST]::/user/v2/signin - Status code is 2xx\", function () {",
- " pm.response.to.be.success;",
- "});",
- "",
- "// Validate if response header has matching content-type",
- "pm.test(\"[POST]::/user/v2/signin - Content-Type is application/json\", function () {",
- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
- " \"application/json\",",
- " );",
- "});",
- "",
- "// Validate if response has JSON Body",
- "pm.test(\"[POST]::/user/v2/signin - Response has JSON Body\", function () {",
- " pm.response.to.have.jsonBody();",
- "});",
- "",
- "// Validate specific JSON response content",
- "pm.test(\"[POST]::/user/v2/signin - Response contains token\", function () {",
- " var jsonData = pm.response.json();",
- " pm.expect(jsonData).to.have.property(\"token\");",
- " pm.expect(jsonData.token).to.be.a(\"string\").and.to.not.be.empty;",
- "});"
- ],
- "type": "text/javascript"
- }
- },
- {
- "listen": "prerequest",
- "script": {
- "exec": [
- ""
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "Cookie",
- "value": "Cookie_1=value"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\"email\":\"{{user_email}}\",\"password\":\"{{user_password}}\"}"
- },
- "url": {
- "raw": "{{baseUrl}}/user/v2/signin",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "user",
- "v2",
- "signin"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Signin Wrong",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "// Validate status code is 4xx Bad Request",
- "pm.test(\"[POST]::/user/v2/signin - Status code is 401\", function () {",
- " pm.response.to.have.status(401);",
- "});",
- "",
- "// Validate if response header has matching content-type",
- "pm.test(\"[POST]::/user/v2/signin - Content-Type is application/json\", function () {",
- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
- " \"application/json\",",
- " );",
- "});",
- "",
- "// Validate if response has JSON Body",
- "pm.test(\"[POST]::/user/v2/signin - Response has JSON Body\", function () {",
- " pm.response.to.have.jsonBody();",
- "});"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "Cookie",
- "value": "Cookie_1=value"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\"email\":\"{{user_email}}\",\"password\":\"{{wrong_password}}\"}"
- },
- "url": {
- "raw": "{{baseUrl}}/user/v2/signin",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "user",
- "v2",
- "signin"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Signin Token Only",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "// Validate status 2xx",
- "pm.test(\"[POST]::user/v2/signin?token_only=true - Status code is 2xx\", function () {",
- " pm.response.to.be.success;",
- "});",
- "",
- "// Validate if response header has matching content-type",
- "pm.test(\"[POST]::user/v2/signin?token_only=true - Content-Type is application/json\", function () {",
- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
- " \"application/json\",",
- " );",
- "});",
- "",
- "// Validate if response has JSON Body",
- "pm.test(\"[POST]::user/v2/signin?token_only=true - Response has JSON Body\", function () {",
- " pm.response.to.have.jsonBody();",
- "});",
- "",
- "// Validate specific JSON response content",
- "pm.test(\"[POST]::user/v2/signin?token_only=true - Response contains token\", function () {",
- " var jsonData = pm.response.json();",
- " pm.expect(jsonData).to.have.property(\"token\");",
- " pm.expect(jsonData.token).to.be.a(\"string\").and.to.not.be.empty;",
- "});"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "Cookie",
- "value": "Cookie_1=value"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\"email\":\"{{user_email}}\",\"password\":\"{{user_password}}\"}"
- },
- "url": {
- "raw": "{{baseUrl}}/user/v2/signin?token_only=true",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "user",
- "v2",
- "signin"
- ],
- "query": [
- {
- "key": "token_only",
- "value": "true"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "Signin Token Only Wrong",
- "event": [
- {
- "listen": "test",
- "script": {
- "exec": [
- "// Validate status 4xx",
- "pm.test(\"[POST]::/user/v2/signin?token_only=true - Status code is 401\", function () {",
- " pm.response.to.have.status(401);",
- "});",
- "",
- "// Validate if response header has matching content-type",
- "pm.test(\"[POST]::user/v2/signin?token_only=true - Content-Type is application/json\", function () {",
- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
- " \"application/json\",",
- " );",
- "});",
- "",
- "// Validate if response has JSON Body",
- "pm.test(\"[POST]::user/v2/signin?token_only=true - Response has JSON Body\", function () {",
- " pm.response.to.have.jsonBody();",
- "});"
- ],
- "type": "text/javascript"
- }
- }
- ],
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "Cookie",
- "value": "Cookie_1=value"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\"email\":\"{{user_email}}\",\"password\":\"{{wrong_password}}\"}"
- },
- "url": {
- "raw": "{{baseUrl}}/user/v2/signin?token_only=true",
- "host": [
- "{{baseUrl}}"
- ],
- "path": [
- "user",
- "v2",
- "signin"
- ],
- "query": [
- {
- "key": "token_only",
- "value": "true"
- }
- ]
- }
- },
- "response": []
- }
- ]
- }
- ]
- }
- ],
- "info": {
- "_postman_id": "b5b40c9a-7e58-42c7-8b89-0adb208c45c9",
- "name": "users",
- "description": "## Get started\n\nJuspay Router provides a collection of APIs that enable you to process and manage payments. Our APIs accept and return JSON in the HTTP body, and return standard HTTP response codes. \nYou can consume the APIs directly using your favorite HTTP/REST library. \nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without affecting production data.\n\n### Base URLs\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n| --- | --- |\n| Sandbox | [https://sandbox.hyperswitch.io](https://sandbox.hyperswitch.io) |\n| Production | [https://router.juspay.io](https://router.juspay.io) |\n\n# Authentication\n\nWhen you sign up for an account, you are given a secret key (also referred as api-key). You may authenticate all API requests with Juspay server by providing the appropriate key in the request Authorization header. \nNever share your secret api keys. Keep them guarded and secure.\n\nContact Support: \nName: Juspay Support \nEmail: [[email protected]](mailto:[email protected])",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
- "_exporter_id": "26710321"
- },
- "variable": [
- {
- "key": "baseUrl",
- "value": "",
- "type": "string"
- },
- {
- "key": "admin_api_key",
- "value": "",
- "type": "string"
- },
- {
- "key": "api_key",
- "value": "",
- "type": "string"
- },
- {
- "key": "merchant_id",
- "value": ""
- },
- {
- "key": "payment_id",
- "value": ""
- },
- {
- "key": "customer_id",
- "value": ""
- },
- {
- "key": "mandate_id",
- "value": ""
- },
- {
- "key": "payment_method_id",
- "value": ""
- },
- {
- "key": "refund_id",
- "value": ""
- },
- {
- "key": "merchant_connector_id",
- "value": ""
- },
- {
- "key": "client_secret",
- "value": "",
- "type": "string"
- },
- {
- "key": "connector_api_key",
- "value": "",
- "type": "string"
- },
- {
- "key": "publishable_key",
- "value": "",
- "type": "string"
- },
- {
- "key": "api_key_id",
- "value": "",
- "type": "string"
- },
- {
- "key": "payment_token",
- "value": ""
- },
- {
- "key": "gateway_merchant_id",
- "value": "",
- "type": "string"
- },
- {
- "key": "certificate",
- "value": "",
- "type": "string"
- },
- {
- "key": "certificate_keys",
- "value": "",
- "type": "string"
- },
- {
- "key": "connector_api_secret",
- "value": "",
- "type": "string"
- },
- {
- "key": "connector_key1",
- "value": "",
- "type": "string"
- },
- {
- "key": "connector_key2",
- "value": "",
- "type": "string"
- },
- {
- "key": "user_email",
- "value": "",
- "type": "string"
- },
- {
- "key": "user_password",
- "value": "",
- "type": "string"
- },
- {
- "key": "wrong_password",
- "value": "",
- "type": "string"
- },
- {
- "key": "user_base_email_for_signup",
- "value": "",
- "type": "string"
- },
- {
- "key": "user_domain_for_signup",
- "value": "",
- "type": "string"
- }
- ]
-}
+ "info": {
+ "_postman_id": "b5b40c9a-7e58-42c7-8b89-0adb208c45c9",
+ "name": "users",
+ "description": "## Get started\n\nJuspay Router provides a collection of APIs that enable you to process and manage payments. Our APIs accept and return JSON in the HTTP body, and return standard HTTP response codes. \nYou can consume the APIs directly using your favorite HTTP/REST library. \nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without affecting production data.\n\n### Base URLs\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n| --- | --- |\n| Sandbox | [https://sandbox.hyperswitch.io](https://sandbox.hyperswitch.io) |\n| Production | [https://router.juspay.io](https://router.juspay.io) |\n\n# Authentication\n\nWhen you sign up for an account, you are given a secret key (also referred as api-key). You may authenticate all API requests with Juspay server by providing the appropriate key in the request Authorization header. \nNever share your secret api keys. Keep them guarded and secure.\n\nContact Support: \nName: Juspay Support \nEmail: [[email protected]](mailto:[email protected])",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
+ "_exporter_id": "26710321"
+ },
+ "item": [
+ {
+ "name": "Health check",
+ "item": [
+ {
+ "name": "New Request",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx",
+ "pm.test(\"[POST]::/health - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/health",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "health"
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+ },
+ {
+ "name": "Flow Testcases",
+ "item": [
+ {
+ "name": "Sign Up",
+ "item": [
+ {
+ "name": "Connect Account",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
+ "",
+ "// Validate status 2xx",
+ "pm.test(\"[POST]::/user/connect_account - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/user/connect_account - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
+ " \"application/json\",",
+ " );",
+ "});",
+ "",
+ "// Validate if response has JSON Body",
+ "pm.test(\"[POST]::/user/connect_account - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Validate specific JSON response content",
+ "pm.test(\"[POST]::/user/connect_account - Response contains is_email_sent\", function () {",
+ " var jsonData = pm.response.json();",
+ " pm.expect(jsonData).to.have.property(\"is_email_sent\");",
+ " pm.expect(jsonData.is_email_sent).to.be.true;",
+ "});",
+ "",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ },
+ {
+ "listen": "prerequest",
+ "script": {
+ "exec": [
+ "",
+ "var baseEmail = pm.environment.get('user_base_email_for_signup');",
+ "var emailDomain = pm.environment.get(\"user_domain_for_signup\");",
+ "",
+ "// Generate a unique email address",
+ "var uniqueEmail = baseEmail + new Date().getTime() + emailDomain;",
+ "// Set the unique email address as an environment variable",
+ "pm.environment.set('unique_email', uniqueEmail);",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Cookie",
+ "value": "Cookie_1=value"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"email\": \"{{unique_email}}\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/user/connect_account",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "user",
+ "connect_account"
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+ },
+ {
+ "name": "Sign In",
+ "item": [
+ {
+ "name": "Signin",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
+ "",
+ "// Validate status 2xx",
+ "pm.test(\"[POST]::/user/v2/signin - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/user/v2/signin - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
+ " \"application/json\",",
+ " );",
+ "});",
+ "",
+ "// Validate if response has JSON Body",
+ "pm.test(\"[POST]::/user/v2/signin - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Validate specific JSON response content",
+ "pm.test(\"[POST]::/user/v2/signin - Response contains token\", function () {",
+ " var jsonData = pm.response.json();",
+ " pm.expect(jsonData).to.have.property(\"token\");",
+ " pm.expect(jsonData.token).to.be.a(\"string\").and.to.not.be.empty;",
+ "});"
+ ],
+ "type": "text/javascript"
+ }
+ },
+ {
+ "listen": "prerequest",
+ "script": {
+ "exec": [
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Cookie",
+ "value": "Cookie_1=value"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"email\": \"{{user_email}}\",\n \"password\": \"{{user_password}}\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/user/v2/signin",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "user",
+ "v2",
+ "signin"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Signin Wrong",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
+ "",
+ "// Validate status code is 4xx Bad Request",
+ "pm.test(\"[POST]::/user/v2/signin - Status code is 401\", function () {",
+ " pm.response.to.have.status(401);",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/user/v2/signin - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
+ " \"application/json\",",
+ " );",
+ "});",
+ "",
+ "// Validate if response has JSON Body",
+ "pm.test(\"[POST]::/user/v2/signin - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});"
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Cookie",
+ "value": "Cookie_1=value"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"email\": \"{{user_email}}\",\n \"password\": \"{{wrong_password}}\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/user/v2/signin",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "user",
+ "v2",
+ "signin"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Signin Token Only",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
+ "",
+ "// Validate status 2xx",
+ "pm.test(\"[POST]::user/v2/signin?token_only=true - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::user/v2/signin?token_only=true - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
+ " \"application/json\",",
+ " );",
+ "});",
+ "",
+ "// Validate if response has JSON Body",
+ "pm.test(\"[POST]::user/v2/signin?token_only=true - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Validate specific JSON response content",
+ "pm.test(\"[POST]::user/v2/signin?token_only=true - Response contains token\", function () {",
+ " var jsonData = pm.response.json();",
+ " pm.expect(jsonData).to.have.property(\"token\");",
+ " pm.expect(jsonData.token).to.be.a(\"string\").and.to.not.be.empty;",
+ "});"
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Cookie",
+ "value": "Cookie_1=value"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"email\": \"{{user_email}}\",\n \"password\": \"{{user_password}}\" \n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/user/v2/signin?token_only=true",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "user",
+ "v2",
+ "signin"
+ ],
+ "query": [
+ {
+ "key": "token_only",
+ "value": "true"
+ }
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Signin Token Only Wrong",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
+ "",
+ "// Validate status 4xx",
+ "pm.test(\"[POST]::/user/v2/signin?token_only=true - Status code is 401\", function () {",
+ " pm.response.to.have.status(401);",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::user/v2/signin?token_only=true - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",
+ " \"application/json\",",
+ " );",
+ "});",
+ "",
+ "// Validate if response has JSON Body",
+ "pm.test(\"[POST]::user/v2/signin?token_only=true - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});"
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Cookie",
+ "value": "Cookie_1=value"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"email\": \"{{user_email}}\",\n \"password\": \"{{wrong_password}}\" \n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/user/v2/signin?token_only=true",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "user",
+ "v2",
+ "signin"
+ ],
+ "query": [
+ {
+ "key": "token_only",
+ "value": "true"
+ }
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "event": [
+ {
+ "listen": "prerequest",
+ "script": {
+ "type": "text/javascript",
+ "exec": [
+ ""
+ ]
+ }
+ },
+ {
+ "listen": "test",
+ "script": {
+ "type": "text/javascript",
+ "exec": [
+ ""
+ ]
+ }
+ }
+ ],
+ "variable": [
+ {
+ "key": "baseUrl",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "admin_api_key",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "api_key",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "merchant_id",
+ "value": ""
+ },
+ {
+ "key": "payment_id",
+ "value": ""
+ },
+ {
+ "key": "customer_id",
+ "value": ""
+ },
+ {
+ "key": "mandate_id",
+ "value": ""
+ },
+ {
+ "key": "payment_method_id",
+ "value": ""
+ },
+ {
+ "key": "refund_id",
+ "value": ""
+ },
+ {
+ "key": "merchant_connector_id",
+ "value": ""
+ },
+ {
+ "key": "client_secret",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "connector_api_key",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "publishable_key",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "api_key_id",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "payment_token",
+ "value": ""
+ },
+ {
+ "key": "gateway_merchant_id",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "certificate",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "certificate_keys",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "connector_api_secret",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "connector_key1",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "connector_key2",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "user_email",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "user_password",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "wrong_password",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "user_base_email_for_signup",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "user_domain_for_signup",
+ "value": "",
+ "type": "string"
+ }
+ ]
+}
\ No newline at end of file