Skip to content

Commit 8a396a2

Browse files
ci(postman): Added address update test cases (#2555)
1 parent 1afae7e commit 8a396a2

File tree

44 files changed

+1193
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1193
-4
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"info": {
3-
"_postman_id": "8690e6f5-b693-42f3-a9f5-a1492faecdd6",
4-
"name": "stripe",
3+
"_postman_id": "a553df38-fa33-4522-b029-1cd32821730e",
4+
"name": "Stripe Postman Collection",
55
"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])",
66
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
7-
"_exporter_id": "25737662"
7+
"_exporter_id": "24206034"
88
}
99
}

postman/collection-dir/stripe/Flow Testcases/Happy Cases/.meta.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"Scenario18-Bank Redirect-giropay",
2121
"Scenario19-Bank Transfer-ach",
2222
"Scenario19-Bank Debit-ach",
23-
"Scenario22-Wallet-Wechatpay"
23+
"Scenario22-Wallet-Wechatpay",
24+
"Scenario22- Update address and List Payment method",
25+
"Scenario23- Update Amount"
2426
]
2527
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"childrenOrder": [
3+
"Payments - Create",
4+
"List Payment Methods for a Merchant",
5+
"Payments - Update",
6+
"List Payment Methods for a Merchant-copy",
7+
"Payments - Confirm",
8+
"Payments - Retrieve"
9+
]
10+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"eventOrder": [
3+
"event.test.js"
4+
]
5+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Validate status 2xx
2+
pm.test("[GET]::/payment_methods/:merchant_id - Status code is 2xx", function () {
3+
pm.response.to.be.success;
4+
});
5+
6+
// Validate if response header has matching content-type
7+
pm.test("[GET]::/payment_methods/:merchant_id - Content-Type is application/json", function () {
8+
pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
9+
});
10+
11+
12+
// Parse the response body as JSON
13+
var responseBody = pm.response.json();
14+
15+
// Check if "payment_methods" array contains a "payment_method" with the value "card"
16+
pm.test("[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'card'", function () {
17+
var paymentMethods = responseBody.payment_methods;
18+
var cardPaymentMethod = paymentMethods.find(function (method) {
19+
return method.payment_method == "card";
20+
});
21+
});
22+
23+
// Check if "payment_methods" array contains a "payment_method" with the value "ideal"
24+
pm.test("[GET]::/payment_methods/:merchant_id - Content Check if payment_method matches 'ideal'", function () {
25+
var paymentMethods = responseBody.payment_methods;
26+
var cardPaymentMethod = paymentMethods.find(function (method) {
27+
return method.payment_method == "ideal";
28+
});
29+
});
30+
31+
// Check if "payment_methods" array contains a "payment_method" with the value "bank_redirect"
32+
pm.test("[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'bank_redirect'", function () {
33+
var paymentMethods = responseBody.payment_methods;
34+
var cardPaymentMethod = paymentMethods.find(function (method) {
35+
return method.payment_method == "bank_redirect";
36+
});
37+
});
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"auth": {
3+
"type": "apikey",
4+
"apikey": [
5+
{
6+
"key": "value",
7+
"value": "{{publishable_key}}",
8+
"type": "string"
9+
},
10+
{
11+
"key": "key",
12+
"value": "api-key",
13+
"type": "string"
14+
},
15+
{
16+
"key": "in",
17+
"value": "header",
18+
"type": "string"
19+
}
20+
]
21+
},
22+
"method": "GET",
23+
"header": [
24+
{
25+
"key": "Accept",
26+
"value": "application/json"
27+
},
28+
{
29+
"key": "x-feature",
30+
"value": "router-custom",
31+
"type": "text",
32+
"disabled": true
33+
}
34+
],
35+
"body": {
36+
"mode": "raw",
37+
"raw": "",
38+
"options": {
39+
"raw": {
40+
"language": "json"
41+
}
42+
}
43+
},
44+
"url": {
45+
"raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}",
46+
"host": [
47+
"{{baseUrl}}"
48+
],
49+
"path": [
50+
"account",
51+
"payment_methods"
52+
],
53+
"query": [
54+
{
55+
"key": "client_secret",
56+
"value": "{{client_secret}}"
57+
}
58+
]
59+
},
60+
"description": "To filter and list the applicable payment methods for a particular merchant id."
61+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"eventOrder": [
3+
"event.test.js"
4+
]
5+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Validate status 2xx
2+
pm.test("[GET]::/payment_methods/:merchant_id - Status code is 2xx", function () {
3+
pm.response.to.be.success;
4+
});
5+
6+
// Validate if response header has matching content-type
7+
pm.test("[GET]::/payment_methods/:merchant_id - Content-Type is application/json", function () {
8+
pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
9+
});
10+
11+
// Parse the response body as JSON
12+
var responseBody = pm.response.json();
13+
14+
// Check if "payment_methods" array contains a "payment_method" with the value "card"
15+
pm.test("[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'card'", function () {
16+
var paymentMethods = responseBody.payment_methods;
17+
var cardPaymentMethod = paymentMethods.find(function (method) {
18+
return method.payment_method == "card";
19+
});
20+
});
21+
22+
// Check if "payment_methods" array contains a "payment_method" with the value "pay_later"
23+
pm.test("[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'pay_later'", function () {
24+
var paymentMethods = responseBody.payment_methods;
25+
var cardPaymentMethod = paymentMethods.find(function (method) {
26+
return method.payment_method == "pay_later";
27+
});
28+
});
29+
// Check if "payment_methods" array contains a "payment_method" with the value "wallet"
30+
pm.test("[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'wallet'", function () {
31+
var paymentMethods = responseBody.payment_methods;
32+
var cardPaymentMethod = paymentMethods.find(function (method) {
33+
return method.payment_method == "wallet";
34+
});
35+
});
36+
37+
// Check if "payment_methods" array contains a "payment_method" with the value "bank_debit"
38+
pm.test("[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'bank_debit'", function () {
39+
var paymentMethods = responseBody.payment_methods;
40+
var cardPaymentMethod = paymentMethods.find(function (method) {
41+
return method.payment_method == "bank_debit";
42+
});
43+
});
44+
45+
// Check if "payment_methods" array contains a "payment_method" with the value "bank_transfer"
46+
pm.test("[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'bank_transfer'", function () {
47+
var paymentMethods = responseBody.payment_methods;
48+
var cardPaymentMethod = paymentMethods.find(function (method) {
49+
return method.payment_method == "bank_transfer";
50+
});
51+
});
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"auth": {
3+
"type": "apikey",
4+
"apikey": [
5+
{
6+
"key": "value",
7+
"value": "{{publishable_key}}",
8+
"type": "string"
9+
},
10+
{
11+
"key": "key",
12+
"value": "api-key",
13+
"type": "string"
14+
},
15+
{
16+
"key": "in",
17+
"value": "header",
18+
"type": "string"
19+
}
20+
]
21+
},
22+
"method": "GET",
23+
"header": [
24+
{
25+
"key": "Accept",
26+
"value": "application/json"
27+
},
28+
{
29+
"key": "x-feature",
30+
"value": "router-custom",
31+
"type": "text",
32+
"disabled": true
33+
}
34+
],
35+
"body": {
36+
"mode": "raw",
37+
"raw": "",
38+
"options": {
39+
"raw": {
40+
"language": "json"
41+
}
42+
}
43+
},
44+
"url": {
45+
"raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}",
46+
"host": [
47+
"{{baseUrl}}"
48+
],
49+
"path": [
50+
"account",
51+
"payment_methods"
52+
],
53+
"query": [
54+
{
55+
"key": "client_secret",
56+
"value": "{{client_secret}}"
57+
}
58+
]
59+
},
60+
"description": "To filter and list the applicable payment methods for a particular merchant id."
61+
}

0 commit comments

Comments
 (0)