-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(postman): update postman collection files
- Loading branch information
1 parent
e40a293
commit 772f03e
Showing
2 changed files
with
324 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -532,7 +532,7 @@ | |
"language": "json" | ||
} | ||
}, | ||
"raw": "{\"amount\":6540,\"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\":\"+1\",\"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\":\"4242424242424242\",\"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\":\"someone\",\"last_name\":\"happy\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"someone\",\"last_name\":\"happy\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}" | ||
"raw": "{\"amount\":6540,\"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\":\"+1\",\"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\":\"4242424242424242\",\"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\":\"someone\",\"last_name\":\"happy\"}},\"routing\":{\"type\":\"single\",\"data\":\"multisafepay\"},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"someone\",\"last_name\":\"happy\"}},\"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", | ||
|
@@ -1875,6 +1875,233 @@ | |
{ | ||
"name": "Variation Cases", | ||
"item": [ | ||
{ | ||
"name": "Scenario6- Create payment with Invalid Merchant ID", | ||
"item": [ | ||
{ | ||
"name": "Payment Connector - Update", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"exec": [ | ||
"// Validate status 2xx", | ||
"pm.test(", | ||
" \"[POST]::/account/:account_id/connectors/:connector_id - Status code is 2xx\",", | ||
" function () {", | ||
" pm.response.to.be.success;", | ||
" },", | ||
");", | ||
"", | ||
"// Validate if response header has matching content-type", | ||
"pm.test(", | ||
" \"[POST]::/account/:account_id/connectors/:connector_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) {}", | ||
"", | ||
"// pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id", | ||
"if (jsonData?.merchant_connector_id) {", | ||
" pm.collectionVariables.set(", | ||
" \"merchant_connector_id\",", | ||
" jsonData.merchant_connector_id,", | ||
" );", | ||
" console.log(", | ||
" \"- use {{merchant_connector_id}} as collection variable for value\",", | ||
" jsonData.merchant_connector_id,", | ||
" );", | ||
"} else {", | ||
" console.log(", | ||
" \"INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.\",", | ||
" );", | ||
"}", | ||
"" | ||
], | ||
"type": "text/javascript" | ||
} | ||
} | ||
], | ||
"request": { | ||
"auth": { | ||
"type": "apikey", | ||
"apikey": [ | ||
{ | ||
"key": "value", | ||
"value": "{{admin_api_key}}", | ||
"type": "string" | ||
}, | ||
{ | ||
"key": "key", | ||
"value": "api-key", | ||
"type": "string" | ||
}, | ||
{ | ||
"key": "in", | ||
"value": "header", | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "Content-Type", | ||
"value": "application/json" | ||
}, | ||
{ | ||
"key": "Accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"body": { | ||
"mode": "raw", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
} | ||
}, | ||
"raw": "{\"connector_type\":\"fiz_operations\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"wrongAPIKey\"},\"test_mode\":false,\"disabled\":false,\"payment_methods_enabled\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"card_networks\":[\"Visa\",\"Mastercard\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"debit\",\"card_networks\":[\"Visa\",\"Mastercard\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"payment_method_type\":\"klarna\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"affirm\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"afterpay_clearpay\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"metadata\":{\"city\":\"NY\",\"unit\":\"245\"}}" | ||
}, | ||
"url": { | ||
"raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id", | ||
"host": [ | ||
"{{baseUrl}}" | ||
], | ||
"path": [ | ||
"account", | ||
":account_id", | ||
"connectors", | ||
":connector_id" | ||
], | ||
"variable": [ | ||
{ | ||
"key": "account_id", | ||
"value": "{{merchant_id}}" | ||
}, | ||
{ | ||
"key": "connector_id", | ||
"value": "{{merchant_connector_id}}" | ||
} | ||
] | ||
}, | ||
"description": "To update an existing Payment Connector. Helpful in enabling / disabling different payment methods and other settings for the connector etc" | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Payments - Create", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"exec": [ | ||
"// 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) {}", | ||
"", | ||
"// Validate error message in the JSON Body", | ||
"pm.test(\"[POST]::/payments - Validate error message\", function () {", | ||
" pm.expect(jsonData.error_message).to.not.be.null", | ||
"});", | ||
"", | ||
"// 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 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.\",", | ||
" );", | ||
"}", | ||
"" | ||
], | ||
"type": "text/javascript" | ||
} | ||
} | ||
], | ||
"request": { | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "Content-Type", | ||
"value": "application/json" | ||
}, | ||
{ | ||
"key": "Accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"body": { | ||
"mode": "raw", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
} | ||
}, | ||
"raw": "{\"amount\":6540,\"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\":\"+1\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"routing\":{\"type\":\"single\",\"data\":\"multisafepay\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"someone\",\"last_name\":\"happy\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"someone\",\"last_name\":\"happy\"}},\"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" | ||
}, | ||
"response": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Scenario1-Create payment with Invalid card details", | ||
"item": [ | ||
|
Oops, something went wrong.