Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/postman-collection-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
CONNECTOR_AUTH_PASSPHRASE: ${{ secrets.CONNECTOR_AUTH_PASSPHRASE }}
CONNECTOR_CREDS_S3_BUCKET_URI: ${{ secrets.CONNECTOR_CREDS_S3_BUCKET_URI}}
DESTINATION_FILE_NAME: "connector_auth.toml.gpg"
S3_SOURCE_FILE_NAME: "cf05a6ab-525e-4888-98b3-3b4a443b87c0.toml.gpg"
S3_SOURCE_FILE_NAME: "95aa1243-4caa-4539-a65a-723aa5cbe3d7.toml.gpg"
shell: bash
run: |
mkdir -p ${HOME}/target/secrets ${HOME}/target/test
Expand Down
5 changes: 4 additions & 1 deletion postman/collection-dir/nmi/.event.meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"eventOrder": ["event.prerequest.js", "event.test.js"]
"eventOrder": [
"event.prerequest.js",
"event.test.js"
]
}
2 changes: 1 addition & 1 deletion postman/collection-dir/nmi/.info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "4de44872-bdff-465f-a958-52988651e0b8",
"_postman_id": "83b726fc-8895-4afd-8f07-a9545e209490",
"name": "nmi",
"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",
Expand Down
5 changes: 4 additions & 1 deletion postman/collection-dir/nmi/.meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"childrenOrder": ["Health check", "Flow Testcases"]
"childrenOrder": [
"Health check",
"Flow Testcases"
]
}
5 changes: 5 additions & 0 deletions postman/collection-dir/nmi/.variable.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
"value": "",
"type": "string"
},
{
"key": "connector_key1",
"value": "",
"type": "string"
},
{
"key": "publishable_key",
"value": "",
Expand Down
6 changes: 5 additions & 1 deletion postman/collection-dir/nmi/Flow Testcases/.meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"]
"childrenOrder": [
"QuickStart",
"Happy Cases",
"Variation Cases"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@
"childrenOrder": [
"Scenario1-Create payment with confirm true",
"Scenario2-Create payment with confirm false",
"Scenario2a-Create payment with confirm false card holder name null",
"Scenario2b-Create payment with confirm false card holder name empty",
"Scenario3-Create payment without PMD",
"Scenario4-Create payment with Manual capture",
"Scenario5-Void the payment",
"Scenario9-Refund full payment",
"Scenario10-Partial refund"
"Scenario6-Refund full payment",
"Scenario7-Partial refund",
"Scenario8-Create a failure card payment with confirm true",
"Scenario9-Update amount with automatic capture",
"Scenario9a-Update amount with manual capture",
"Scenario10-Create a mandate and recurring payment Copy",
"Scenario11-Refund recurring payment Copy",
"Scenario12-Add card flow",
"Scenario13-Don't Pass CVV for save card flow and verify success payment",
"Scenario14-Save card payment with manual capture",
"Scenario15-Create payment without customer_id and with billing address and shipping address"
]
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"childrenOrder": ["Payments - Create", "Payments - Retrieve"]
"childrenOrder": [
"Payments - Create",
"Payments - Retrieve"
]
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"eventOrder": ["event.test.js"]
"eventOrder": ["event.prerequest.js", "event.test.js"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pm.environment.set("random_number", _.random(1000, 100000));
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pm.environment.set("random_number", _.random(100, 100000));

// Validate status 2xx
pm.test("[POST]::/payments - Status code is 2xx", function () {
pm.response.to.be.success;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,67 @@
],
"body": {
"mode": "raw",
"raw": "{\n \"amount\": {{random_number}},\n \"currency\": \"USD\",\n \"confirm\": true,\n \"capture_method\": \"automatic\",\n \"capture_on\": \"2022-09-10T10:11:12Z\",\n \"amount_to_capture\": {{random_number}},\n \"customer_id\": \"StripeCustomer\",\n \"email\": \"[email protected]\",\n \"name\": \"John Doe\",\n \"phone\": \"999999999\",\n \"phone_country_code\": \"+65\",\n \"description\": \"Its my first payment request\",\n \"authentication_type\": \"no_three_ds\",\n \"return_url\": \"https://duck.com\",\n \"payment_method\": \"card\",\n \"payment_method_data\": {\n \"card\": {\n \"card_number\": \"4111111111111111\",\n \"card_exp_month\": \"10\",\n \"card_exp_year\": \"25\",\n \"card_holder_name\": \"joseph Doe\",\n \"card_cvc\": \"123\"\n }\n },\n \"billing\": {\n \"address\": {\n \"line1\": \"1467\",\n \"line2\": \"Harrison Street\",\n \"line3\": \"Harrison Street\",\n \"city\": \"San Fransico\",\n \"state\": \"California\",\n \"zip\": \"94122\",\n \"country\": \"US\",\n \"first_name\": \"PiX\"\n }\n },\n \"shipping\": {\n \"address\": {\n \"line1\": \"1467\",\n \"line2\": \"Harrison Street\",\n \"line3\": \"Harrison Street\",\n \"city\": \"San Fransico\",\n \"state\": \"California\",\n \"zip\": \"94122\",\n \"country\": \"US\",\n \"first_name\": \"PiX\"\n }\n },\n \"statement_descriptor_name\": \"joseph\",\n \"statement_descriptor_suffix\": \"JS\",\n \"metadata\": {\n \"udf1\": \"value1\",\n \"new_customer\": \"true\",\n \"login_date\": \"2019-09-10T10:11:12Z\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
},
"raw_json_formatted": {
"amount": "{{random_number}}",
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": "{{random_number}}",
"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",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"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"
}
}
},
"url": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"eventOrder": ["event.test.js"]
"eventOrder": [
"event.test.js"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
],
"url": {
"raw": "{{baseUrl}}/payments/:id?force_sync=true",
"host": ["{{baseUrl}}"],
"path": ["payments", ":id"],
"host": [
"{{baseUrl}}"
],
"path": [
"payments",
":id"
],
"query": [
{
"key": "force_sync",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"childrenOrder": [
"Payments - Create",
"Payments - Retrieve",
"Recurring Payments - Create",
"Payments - Retrieve-copy"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eventOrder": ["event.prerequest.js", "event.test.js"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pm.environment.set("random_number", _.random(100, 100000));
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// 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;
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"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": "{{random_number}}",
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": "{{random_number}}",
"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",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "10",
"card_exp_year": "69",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"setup_future_usage": "off_session",
"mandate_data": {
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"single_use": {
"amount": 100000,
"currency": "USD"
}
}
},
"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"
}
}
},
"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"
}
Loading