diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/.meta.json index 5f65896adb0..7d5a8078af1 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/.meta.json @@ -1,6 +1,7 @@ { "childrenOrder": [ "Payments - Create", + "Payments - Retrieve", "List payment methods for a Customer", "Save card payments - Create", "Save card payments - Confirm", diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/Payments - Retrieve/event.test.js index d0a02af7436..814cc4496dd 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/Payments - Retrieve/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/Payments - Retrieve/event.test.js @@ -6,7 +6,7 @@ pm.test("[GET]::/payments/:id - Status code is 2xx", function () { // Validate if response header has matching content-type pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { pm.expect(pm.response.headers.get("Content-Type")).to.include( - "application/json", + "application/json" ); }); @@ -26,11 +26,11 @@ if (jsonData?.payment_id) { pm.collectionVariables.set("payment_id", jsonData.payment_id); console.log( "- use {{payment_id}} as collection variable for value", - jsonData.payment_id, + jsonData.payment_id ); } else { console.log( - "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.", + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined." ); } @@ -39,11 +39,11 @@ if (jsonData?.mandate_id) { pm.collectionVariables.set("mandate_id", jsonData.mandate_id); console.log( "- use {{mandate_id}} as collection variable for value", - jsonData.mandate_id, + jsonData.mandate_id ); } else { console.log( - "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.", + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined." ); } @@ -52,10 +52,10 @@ if (jsonData?.client_secret) { pm.collectionVariables.set("client_secret", jsonData.client_secret); console.log( "- use {{client_secret}} as collection variable for value", - jsonData.client_secret, + jsonData.client_secret ); } else { console.log( - "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.", + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined." ); } diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/Payments - Retrieve/request.json index c71774083b2..6cd4b7d96c5 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/Payments - Retrieve/request.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario10-Add card flow/Payments - Retrieve/request.json @@ -7,13 +7,14 @@ } ], "url": { - "raw": "{{baseUrl}}/payments/:id", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "payments", - ":id" + "raw": "{{baseUrl}}/payments/:id?force_sync=true", + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], + "query": [ + { + "key": "force_sync", + "value": "true" + } ], "variable": [ { diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/.meta.json index 1ebea8f5e86..9fdf39812c1 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/.meta.json +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/.meta.json @@ -1,8 +1,8 @@ { "childrenOrder": [ "Payments - Create", + "Payments - Retrieve", "List payment methods for a Customer", "Save card payments - Create", "Save card payments - Confirm" - ] -} + ]} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Create/event.test.js index cd3e43df900..c2bed81a7b1 100644 --- a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Create/event.test.js +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Create/event.test.js @@ -1,46 +1,64 @@ -// Validate status 2xx +// Validate status 2xx pm.test("[POST]::/payments - Status code is 2xx", function () { - pm.response.to.be.success; + pm.response.to.be.success; }); // Validate if response header has matching content-type pm.test("[POST]::/payments - Content-Type is application/json", function () { - pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json"); + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json" + ); }); -// Validate if response has JSON Body +// Validate if response has JSON Body pm.test("[POST]::/payments - Response has JSON Body", function () { - pm.response.to.have.jsonBody(); + pm.response.to.have.jsonBody(); }); // Set response object as internal variable let jsonData = {}; -try {jsonData = pm.response.json();}catch(e){} +try { + jsonData = pm.response.json(); +} catch (e) {} // pm.collectionVariables - Set payment_id as variable for jsonData.payment_id if (jsonData?.payment_id) { - pm.collectionVariables.set("payment_id", jsonData.payment_id); - console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id); + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id + ); } else { - console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.'); -}; - + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined." + ); +} // pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id if (jsonData?.mandate_id) { - pm.collectionVariables.set("mandate_id", jsonData.mandate_id); - console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id); + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id + ); } else { - console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined." + ); +} // pm.collectionVariables - Set client_secret as variable for jsonData.client_secret if (jsonData?.client_secret) { - pm.collectionVariables.set("client_secret", jsonData.client_secret); - console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret); + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret + ); } else { - console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.'); -}; + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined." + ); +} // Response body should have value "processing" for "status" if (jsonData?.status) { @@ -48,13 +66,18 @@ if (jsonData?.status) { "[POST]::/payments - Content check if value for 'status' matches 'processing'", function () { pm.expect(jsonData.status).to.eql("processing"); - }, + } ); } if (jsonData?.customer_id) { - pm.collectionVariables.set("customer_id", jsonData.customer_id); - console.log("- use {{customer_id}} as collection variable for value",jsonData.customer_id); + pm.collectionVariables.set("customer_id", jsonData.customer_id); + console.log( + "- use {{customer_id}} as collection variable for value", + jsonData.customer_id + ); } else { - console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.'); -}; \ No newline at end of file + console.log( + "INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined." + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/.event.meta.json new file mode 100644 index 00000000000..688c85746ef --- /dev/null +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/.event.meta.json @@ -0,0 +1,5 @@ +{ + "eventOrder": [ + "event.test.js" + ] +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/event.test.js new file mode 100644 index 00000000000..814cc4496dd --- /dev/null +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/event.test.js @@ -0,0 +1,61 @@ +// Validate status 2xx +pm.test("[GET]::/payments/:id - Status code is 2xx", function () { + pm.response.to.be.success; +}); + +// Validate if response header has matching content-type +pm.test("[GET]::/payments/:id - Content-Type is application/json", function () { + pm.expect(pm.response.headers.get("Content-Type")).to.include( + "application/json" + ); +}); + +// Set response object as internal variable +let jsonData = {}; +try { + jsonData = pm.response.json(); +} catch (e) {} + +// Validate if response has JSON Body +pm.test("[GET]::/payments/:id - Response has JSON Body", function () { + pm.response.to.have.jsonBody(); +}); + +// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id +if (jsonData?.payment_id) { + pm.collectionVariables.set("payment_id", jsonData.payment_id); + console.log( + "- use {{payment_id}} as collection variable for value", + jsonData.payment_id + ); +} else { + console.log( + "INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined." + ); +} + +// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id +if (jsonData?.mandate_id) { + pm.collectionVariables.set("mandate_id", jsonData.mandate_id); + console.log( + "- use {{mandate_id}} as collection variable for value", + jsonData.mandate_id + ); +} else { + console.log( + "INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined." + ); +} + +// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret +if (jsonData?.client_secret) { + pm.collectionVariables.set("client_secret", jsonData.client_secret); + console.log( + "- use {{client_secret}} as collection variable for value", + jsonData.client_secret + ); +} else { + console.log( + "INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined." + ); +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/request.json new file mode 100644 index 00000000000..6cd4b7d96c5 --- /dev/null +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/request.json @@ -0,0 +1,28 @@ +{ + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + } + ], + "url": { + "raw": "{{baseUrl}}/payments/:id?force_sync=true", + "host": ["{{baseUrl}}"], + "path": ["payments", ":id"], + "query": [ + { + "key": "force_sync", + "value": "true" + } + ], + "variable": [ + { + "key": "id", + "value": "{{payment_id}}", + "description": "(Required) unique payment id" + } + ] + }, + "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment" +} diff --git a/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/response.json b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/response.json new file mode 100644 index 00000000000..fe51488c706 --- /dev/null +++ b/postman/collection-dir/nmi/Flow Testcases/Happy Cases/Scenario11-Don't Pass CVV for save card flow and verify success payment/Payments - Retrieve/response.json @@ -0,0 +1 @@ +[]