Skip to content

Commit

Permalink
ci(postman): fix postman event.test.js for all connectors (#2174)
Browse files Browse the repository at this point in the history
  • Loading branch information
knutties authored Sep 17, 2023
1 parent 272f5e4 commit 7d988fa
Show file tree
Hide file tree
Showing 16 changed files with 192 additions and 51 deletions.
31 changes: 0 additions & 31 deletions postman/collection-dir/checkout/.event.json

This file was deleted.

Empty file.
13 changes: 13 additions & 0 deletions postman/collection-dir/checkout/event.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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("[LOG]::payment_id - " + jsonData.payment_id);
}

console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
13 changes: 13 additions & 0 deletions postman/collection-dir/forte/event.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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("[LOG]::payment_id - " + jsonData.payment_id);
}

console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
13 changes: 13 additions & 0 deletions postman/collection-dir/hyperswitch/event.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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("[LOG]::payment_id - " + jsonData.payment_id);
}

console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
13 changes: 13 additions & 0 deletions postman/collection-dir/powertranz/event.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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("[LOG]::payment_id - " + jsonData.payment_id);
}

console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
13 changes: 13 additions & 0 deletions postman/collection-dir/rapyd/event.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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("[LOG]::payment_id - " + jsonData.payment_id);
}

console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
18 changes: 0 additions & 18 deletions postman/collection-dir/stripe/.event.json

This file was deleted.

Empty file.
13 changes: 13 additions & 0 deletions postman/collection-dir/stripe/event.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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("[LOG]::payment_id - " + jsonData.payment_id);
}

console.log("[LOG]::x-request-id - " + pm.response.headers.get("x-request-id"));
32 changes: 31 additions & 1 deletion postman/collection-json/checkout.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
{
"event": [
{}
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
"// 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(\"[LOG]::payment_id - \" + jsonData.payment_id);",
"}",
"",
"console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
""
],
"type": "text/javascript"
}
}
],
"item": [
{
Expand Down
13 changes: 13 additions & 0 deletions postman/collection-json/forte.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
"listen": "test",
"script": {
"exec": [
"// 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(\"[LOG]::payment_id - \" + jsonData.payment_id);",
"}",
"",
"console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
""
],
"type": "text/javascript"
Expand Down
13 changes: 13 additions & 0 deletions postman/collection-json/hyperswitch.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
"listen": "test",
"script": {
"exec": [
"// 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(\"[LOG]::payment_id - \" + jsonData.payment_id);",
"}",
"",
"console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
""
],
"type": "text/javascript"
Expand Down
13 changes: 13 additions & 0 deletions postman/collection-json/powertranz.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
"listen": "test",
"script": {
"exec": [
"// 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(\"[LOG]::payment_id - \" + jsonData.payment_id);",
"}",
"",
"console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
""
],
"type": "text/javascript"
Expand Down
13 changes: 13 additions & 0 deletions postman/collection-json/rapyd.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
"listen": "test",
"script": {
"exec": [
"// 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(\"[LOG]::payment_id - \" + jsonData.payment_id);",
"}",
"",
"console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
""
],
"type": "text/javascript"
Expand Down
32 changes: 31 additions & 1 deletion postman/collection-json/stripe.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
{
"event": [
{}
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
"// 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(\"[LOG]::payment_id - \" + jsonData.payment_id);",
"}",
"",
"console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",
""
],
"type": "text/javascript"
}
}
],
"item": [
{
Expand Down

0 comments on commit 7d988fa

Please sign in to comment.