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): Fix Nmi Collection (#4634)

likhinbopannaf5d1201ac9e9
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/.meta.json
index 7e3336a19b..350633e536 100644
--- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/.meta.json
+++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/.meta.json
@@ -7,6 +7,6 @@
"Scenario5-Void the success_slash_failure payment",
"Scenario7-Refund exceeds amount",
"Scenario8-Refund for unsuccessful payment",
- "Scenario9-Create a recurring payment with greater mandate amount Copy"
+ "Scenario9-Create a mandate payment"
]
}
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/.meta.json
similarity index 100%
rename from postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/.meta.json
rename to postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/.meta.json
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/.event.meta.json
similarity index 100%
rename from postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/.event.meta.json
rename to postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/.event.meta.json
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/event.prerequest.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/event.prerequest.js
similarity index 100%
rename from postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/event.prerequest.js
rename to postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/event.prerequest.js
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/event.test.js
new file mode 100644
index 0000000000..b62f99d61f
--- /dev/null
+++ b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/event.test.js
@@ -0,0 +1,42 @@
+// Validate status 4xx
+pm.test("[POST]::/payments - Status code is 4xx", function () {
+ pm.response.to.be.error;
+});
+
+// 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",
+ );
+});
+
+// Validate if response has JSON Body
+pm.test("[POST]::/payments - Response has JSON Body", function () {
+ pm.response.to.have.jsonBody();
+});
+
+// Set response object as internal variable
+let jsonData = {};
+try {
+ jsonData = pm.response.json();
+} catch (e) {}
+
+// Response body should have value "invalid_request" for "error type"
+if (jsonData?.error?.type) {
+ pm.test(
+ "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'" ,
+ function () {
+ pm.expect(jsonData.error.type).to.eql("invalid_request");
+ },
+ );
+}
+
+// Response body should have value "mandate payment is not supported by nmi" for "error reason"
+if (jsonData?.error?.message) {
+ pm.test(
+ "[POST]::/payments/:id/confirm - Content check if value for 'error.reason' matches ' mandate payment is not supported by nmi'" ,
+ function () {
+ pm.expect(jsonData.error.reason).to.eql(" mandate payment is not supported by nmi");
+ },
+ );
+}
\ No newline at end of file
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/request.json
similarity index 100%
rename from postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/request.json
rename to postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/request.json
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/response.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/response.json
similarity index 100%
rename from postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/response.json
rename to postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a mandate payment/Payments - Create/response.json
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/event.test.js
deleted file mode 100644
index e72bc84b8c..0000000000
--- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Create/event.test.js
+++ /dev/null
@@ -1,87 +0,0 @@
-// Validate status 2xx
-pm.test("[POST]::/payments - Status code is 2xx", function () {
- 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",
- );
-});
-
-// Validate if response has JSON Body
-pm.test("[POST]::/payments - Response has JSON Body", function () {
- pm.response.to.have.jsonBody();
-});
-
-// Set response object as internal variable
-let jsonData = {};
-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,
- );
-} 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.",
- );
-}
-
-// Response body should have value "processing" for "status"
-if (jsonData?.status) {
- pm.test(
- "[POST]::/payments - Content check if value for 'status' matches 'processing'",
- function () {
- pm.expect(jsonData.status).to.eql("processing");
- },
- );
-}
-
-// Response body should have "mandate_id"
-pm.test(
- "[POST]::/payments - Content check if 'mandate_id' exists",
- function () {
- pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true;
- },
-);
-
-// Response body should have "mandate_data"
-pm.test(
- "[POST]::/payments - Content check if 'mandate_data' exists",
- function () {
- pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true;
- },
-);
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/.event.meta.json
deleted file mode 100644
index 688c85746e..0000000000
--- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/.event.meta.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "eventOrder": [
- "event.test.js"
- ]
-}
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/event.test.js
deleted file mode 100644
index db584da226..0000000000
--- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/event.test.js
+++ /dev/null
@@ -1,87 +0,0 @@
-// 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",
- );
-});
-
-// Validate if response has JSON Body
-pm.test("[GET]::/payments/:id - Response has JSON Body", function () {
- pm.response.to.have.jsonBody();
-});
-
-// Set response object as internal variable
-let jsonData = {};
-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,
- );
-} 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.",
- );
-}
-
-// Response body should have value "Succeeded" for "status"
-if (jsonData?.status) {
- pm.test(
- "[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'",
- function () {
- pm.expect(jsonData.status).to.eql("succeeded");
- },
- );
-}
-
-// Response body should have "mandate_id"
-pm.test(
- "[POST]::/payments - Content check if 'mandate_id' exists",
- function () {
- pm.expect(typeof jsonData.mandate_id !== "undefined").to.be.true;
- },
-);
-
-// Response body should have "mandate_data"
-pm.test(
- "[POST]::/payments - Content check if 'mandate_data' exists",
- function () {
- pm.expect(typeof jsonData.mandate_data !== "undefined").to.be.true;
- },
-);
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/request.json
deleted file mode 100644
index b9ebc1be4a..0000000000
--- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/request.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "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/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/response.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/response.json
deleted file mode 100644
index fe51488c70..0000000000
--- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Payments - Retrieve/response.json
+++ /dev/null
@@ -1 +0,0 @@
-[]
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/.event.meta.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/.event.meta.json
deleted file mode 100644
index eb871bbcb9..0000000000
--- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/.event.meta.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "eventOrder": ["event.prerequest.js", "event.test.js"]
-}
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/event.prerequest.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/event.prerequest.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/event.test.js b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/event.test.js
deleted file mode 100644
index e862404c2b..0000000000
--- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/event.test.js
+++ /dev/null
@@ -1,79 +0,0 @@
-// Validate status 4xx
-pm.test("[POST]::/payments - Status code is 4xx", function () {
- pm.response.to.be.error;
-});
-
-// 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",
- );
-});
-
-// Validate if response has JSON Body
-pm.test("[POST]::/payments - Response has JSON Body", function () {
- pm.response.to.have.jsonBody();
-});
-
-// Set response object as internal variable
-let jsonData = {};
-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,
- );
-} 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.",
- );
-}
-
-// Response body should have "error"
-pm.test(
- "[POST]::/payments/:id/confirm - Content check if 'error' exists",
- function () {
- pm.expect(typeof jsonData.error !== "undefined").to.be.true;
- },
-);
-
-// Response body should have value "invalid_request" for "error type"
-if (jsonData?.error?.type) {
- pm.test(
- "[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'",
- function () {
- pm.expect(jsonData.error.type).to.eql("invalid_request");
- },
- );
-}
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/request.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/request.json
deleted file mode 100644
index dc9d8fe8cc..0000000000
--- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/request.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json"
- },
- {
- "key": "Accept",
- "value": "application/json"
- }
- ],
- "body": {
- "mode": "raw",
- "options": {
- "raw": {
- "language": "json"
- }
- },
- "raw_json_formatted": {
- "amount": 8040,
- "currency": "USD",
- "confirm": true,
- "capture_method": "automatic",
- "capture_on": "2022-09-10T10:11:12Z",
- "amount_to_capture": 6540,
- "customer_id": "StripeCustomer",
- "email": "[email protected]",
- "name": "John Doe",
- "phone": "999999999",
- "phone_country_code": "+65",
- "description": "Its my first payment request",
- "authentication_type": "no_three_ds",
- "return_url": "https://duck.com",
- "mandate_id": "{{mandate_id}}",
- "off_session": true,
- "billing": {
- "address": {
- "line1": "1467",
- "line2": "Harrison Street",
- "line3": "Harrison Street",
- "city": "San Fransico",
- "state": "California",
- "zip": "94122",
- "country": "US",
- "first_name": "John"
- }
- },
- "shipping": {
- "address": {
- "line1": "1467",
- "line2": "Harrison Street",
- "line3": "Harrison Street",
- "city": "San Fransico",
- "state": "California",
- "zip": "94122",
- "country": "US",
- "first_name": "John"
- }
- },
- "statement_descriptor_name": "joseph",
- "statement_descriptor_suffix": "JS",
- "metadata": {
- "udf1": "value1",
- "new_customer": "true",
- "login_date": "2019-09-10T10:11:12Z"
- },
- "routing": {
- "type": "single",
- "data": "stripe"
- }
- }
- },
- "url": {
- "raw": "{{baseUrl}}/payments",
- "host": ["{{baseUrl}}"],
- "path": ["payments"]
- },
- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"
-}
diff --git a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/response.json b/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/response.json
deleted file mode 100644
index fe51488c70..0000000000
--- a/postman/collection-dir/nmi/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount Copy/Recurring Payments - Create/response.json
+++ /dev/null
@@ -1 +0,0 @@
-[]