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
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
chore(postman): update Postman collection files
github-actions21421d79f22f
diff --git a/postman/collection-json/cybersource.postman_collection.json b/postman/collection-json/cybersource.postman_collection.jsonindex b877aaa563..1bca7f15db 100644--- a/postman/collection-json/cybersource.postman_collection.json+++ b/postman/collection-json/cybersource.postman_collection.json@@ -405,7 +405,7 @@"language": "json"}},- "raw": "{\"connector_type\":\"payment_processor\",\"connector_name\":\"cybersource\",\"connector_account_details\":{\"auth_type\":\"SignatureKey\",\"api_secret\":\"{{connector_api_secret}}\",\"api_key\":\"{{connector_api_key}}\",\"key1\":\"{{connector_key1}}\"},\"test_mode\":false,\"disabled\":false,\"payment_methods_enabled\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"debit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}]}"+ "raw": "{\"connector_type\":\"payment_processor\",\"connector_name\":\"cybersource\",\"connector_account_details\":{\"auth_type\":\"SignatureKey\",\"api_secret\":\"{{connector_api_secret}}\",\"api_key\":\"{{connector_api_key}}\",\"key1\":\"{{connector_key1}}\"},\"test_mode\":false,\"disabled\":false,\"metadata\":{},\"payment_methods_enabled\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"debit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}]}"},"url": {"raw": "{{baseUrl}}/account/:account_id/connectors",@@ -844,7 +844,7 @@"name": "Happy Cases","item": [{- "name": "Scenario1-Create payment with confirm true",+ "name": "Scenario13-Verify PML for mandate","item": [{"name": "Payments - Create",@@ -889,6 +889,19 @@" );","}","",+ "// 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);",@@ -902,22 +915,29 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_confirmation\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");"," },"," );","}","",- "// Response body should have \"connector_transaction_id\"",+ "// Response body should have \"mandate_id\"","pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " \"[POST]::/payments - Content check if 'mandate_id' exists\","," function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",+ " 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;"," },",");",""@@ -945,7 +965,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"01\",\"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\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -961,28 +981,29 @@"response": []},{- "name": "Payments - Retrieve",+ "name": "List payment methods for a Merchant","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",+ "pm.test(",+ " \"[GET]::/payment_methods/:merchant_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();",- "});",+ "pm.test(",+ " \"[GET]::/payment_methods/:merchant_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 = {};",@@ -990,50 +1011,16 @@" 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 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) {",+ "// Response body should have value \"new_mandate\" for \"payment_type\"",+ "if (jsonData?.payment_type) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'payment_type' matches 'new_mandate'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.payment_type).to.eql(\"new_mandate\");"," },"," );","}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",""],"type": "text/javascript"@@ -1041,6 +1028,26 @@}],"request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },"method": "GET","header": [{@@ -1049,39 +1056,27 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"+ "account",+ "payment_methods"],"query": [{- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "key": "client_secret",+ "value": "{{client_secret}}"}]},- "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"+ "description": "To filter and list the applicable payment methods for a particular merchant id."},"response": []- }- ]- },- {- "name": "Scenario2-Create payment with confirm false",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Create-copy","event": [{"listen": "test",@@ -1123,6 +1118,19 @@" );","}","",+ "// 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);",@@ -1136,28 +1144,21 @@" );","}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- " },",+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(",+ " \"- use {{customer_id}} as collection variable for value\",",+ " jsonData.customer_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.\","," );","}",""],"type": "text/javascript"}- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }}],"request": {@@ -1179,7 +1180,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"payment_type\":\"setup_mandate\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -1195,20 +1196,23 @@"response": []},{- "name": "Payments - Confirm",+ "name": "List payment methods for a Merchant-copy","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",+ "pm.test(",+ " \"[GET]::/payment_methods/:merchant_id - Status code is 2xx\",",+ " function () {",+ " pm.response.to.be.success;",+ " },",+ ");","","// Validate if response header has matching content-type","pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",+ " \"[GET]::/payment_methods/:merchant_id - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -1216,50 +1220,19 @@" },",");","",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - 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 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) {",+ "// Response body should have value \"setup_mandate\" for \"payment_type\"",+ "if (jsonData?.payment_type) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'payment_type' matches 'setup_mandate'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.payment_type).to.eql(\"setup_mandate\");"," },"," );","}",@@ -1267,15 +1240,6 @@],"type": "text/javascript"}- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }}],"request": {@@ -1299,69 +1263,59 @@}]},- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"client_secret\":\"{{client_secret}}\",\"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\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"+ "account",+ "payment_methods"],- "variable": [+ "query": [{- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "key": "client_secret",+ "value": "{{client_secret}}"}]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "description": "To filter and list the applicable payment methods for a particular merchant id."},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario14-Revoke mandates",+ "item": [{- "name": "Payments - Retrieve",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments - 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.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(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -1384,6 +1338,19 @@" );","}","",+ "// 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);",@@ -1400,12 +1367,39 @@"// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - 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;",+ " },",+ ");",+ "",""],"type": "text/javascript"@@ -1413,66 +1407,60 @@}],"request": {- "method": "GET",+ "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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "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"+ "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": "Scenario2a-Create payment with confirm false card holder name null",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "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(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "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(\"[POST]::/payments - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -1508,24 +1496,31 @@" );","}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [+ "",+ "// 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;",+ " },",+ ");",""],"type": "text/javascript"@@ -1533,64 +1528,57 @@}],"request": {- "method": "POST",+ "method": "GET","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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"- },"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "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"+ "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"},"response": []},{- "name": "Payments - Confirm",+ "name": "List - Mandates","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",+ "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(",- " \"[POST]::/payments/:id/confirm - 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/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "pm.test(\"[GET]::/payments/: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",@@ -1599,50 +1587,106 @@" 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 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\"",+ "// Response body should have value \"active\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'active'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"active\");"," },"," );","}",- ""- ],+ "",+ "// 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;",+ " },",+ ");",+ "",+ "",+ "",+ ""+ ],"type": "text/javascript"}+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {+ "raw": "{{baseUrl}}/mandates/:id",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "mandates",+ ":id"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{mandate_id}}",+ "description": "(Required) Unique mandate id"+ }+ ]},+ "description": "To list the details of a mandate"+ },+ "response": []+ },+ {+ "name": "Revoke - Mandates",+ "event": [{- "listen": "prerequest",+ "listen": "test","script": {"exec": [+ "// 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\",",+ " );",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "",+ "// Response body should have value \"revoked\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'revoked'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"revoked\");",+ " },",+ " );",+ "}",+ "",+ "// 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;",+ " },",+ ");",+ "",""],"type": "text/javascript"@@ -1650,70 +1694,36 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_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": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":null,\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/mandates/revoke/:id","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"+ "mandates",+ "revoke",+ ":id"],"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{mandate_id}}"}]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "description": "To revoke a mandate registered against a customer"},"response": []},{- "name": "Payments - Retrieve",+ "name": "List - Mandates-copy","event": [{"listen": "test",@@ -1731,52 +1741,33 @@" );","});","",- "// 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 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\"",+ "// Response body should have value \"revoked\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'revoked'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"revoked\");"," },"," );","}",+ "",+ "// 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;",+ " },",+ ");",+ "",+ "",+ "",""],"type": "text/javascript"@@ -1792,36 +1783,30 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/mandates/:id","host": ["{{baseUrl}}"],"path": [- "payments",+ "mandates",":id"],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{mandate_id}}",+ "description": "(Required) Unique mandate 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"+ "description": "To list the details of a mandate"},"response": []}]},{- "name": "Scenario2b-Create payment with confirm false card holder name empty",+ "name": "Scenario15-Create 3ds payment","item": [{"name": "Payments - Create",@@ -1879,24 +1864,24 @@" );","}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"requires_customer_action\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");"," },"," );","}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [+ "",+ "// Response body should have \"connector_transaction_id\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " },",+ ");",""],"type": "text/javascript"@@ -1922,7 +1907,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"online\",\"accepted_at\":\"2022-09-10T10:11:12Z\",\"online\":{\"ip_address\":\"123.32.25.123\",\"user_agent\":\"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}},\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000001000\",\"card_exp_month\":\"01\",\"card_exp_year\":\"35\",\"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\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -1938,29 +1923,26 @@"response": []},{- "name": "Payments - Confirm",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "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(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "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(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -1996,23 +1978,24 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_customer_action\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_customer_action'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");"," },"," );",- "}"- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [+ "}",+ "",+ "// Response body should have \"connector_transaction_id\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " },",+ ");",""],"type": "text/javascript"@@ -2020,26 +2003,126 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {+ "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id"+ ],+ "query": [{- "key": "key",- "value": "api-key",- "type": "string"- },+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [{- "key": "in",- "value": "header",- "type": "string"+ "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"+ },+ "response": []+ }+ ]+ },+ {+ "name": "Scenario16-Create 3ds mandate",+ "item": [+ {+ "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) {}",+ "",+ "// 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.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"requires_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have \"connector_transaction_id\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " },",+ ");",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {"method": "POST","header": [{@@ -2058,27 +2141,18 @@"language": "json"}},- "raw": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"\",\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000001000\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"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\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "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": []},@@ -2138,15 +2212,25 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_customer_action\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_customer_action'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");"," },"," );",- "}"+ "}",+ "",+ "// Response body should have \"connector_transaction_id\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " },",+ ");",+ ""],"type": "text/javascript"}@@ -2190,7 +2274,7 @@]},{- "name": "Scenario3-Create payment without PMD",+ "name": "Scenario17-Create a mandate without customer acceptance","item": [{"name": "Payments - Create",@@ -2235,6 +2319,32 @@" );","}","",+ "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id",+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(",+ " \"- use {{customer_id}} as collection variable for value\",",+ " jsonData.customer_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_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);",@@ -2257,6 +2367,22 @@" },"," );","}",+ "",+ "// 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;",+ " },",+ ");",""],"type": "text/javascript"@@ -2282,7 +2408,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"customer{{$randomAlphaNumeric}}\",\"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\",\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"mandate_type\":{\"single_use\":{\"amount\":7000,\"currency\":\"USD\"}}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -2343,6 +2469,19 @@" );","}","",+ "// 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);",@@ -2355,10 +2494,11 @@" \"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/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },",@@ -2418,7 +2558,7 @@"language": "json"}},- "raw": "{\"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\"}},\"client_secret\":\"{{client_secret}}\"}"+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"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\"}},\"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\":7000,\"currency\":\"USD\"}}},\"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\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"},"url": {"raw": "{{baseUrl}}/payments/:id/confirm",@@ -2498,30 +2638,46 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {+ "",+ "// 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;",+ " },",+ ");",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {"raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"@@ -2547,14 +2703,9 @@"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"},"response": []- }- ]- },- {- "name": "Scenario4-Create payment with Manual capture",- "item": [+ },{- "name": "Payments - Create",+ "name": "Recurring Payments - Create","event": [{"listen": "test",@@ -2596,6 +2747,19 @@" );","}","",+ "// 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);",@@ -2609,15 +2773,39 @@" );","}","",- "// Response body should have value \"requires_capture\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " 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;",+ " },",+ ");",+ "",+ "// Response body should have \"payment_method_data\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",+ " },",+ ");",""],"type": "text/javascript"@@ -2643,7 +2831,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {"raw": "{{baseUrl}}/payments",@@ -2659,29 +2847,26 @@"response": []},{- "name": "Payments - Capture",+ "name": "Payments - Retrieve-copy","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",+ "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(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "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(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -2704,6 +2889,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -2717,35 +2903,31 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}","",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",+ "// 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 value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6540);",- " },",- " );",- "}",+ "// 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;",+ " },",+ ");",""],"type": "text/javascript"@@ -2753,35 +2935,27 @@}],"request": {- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":6540,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/capture",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": ["payments",- ":id",- "capture"+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }],"variable": [{@@ -2791,31 +2965,36 @@}]},- "description": "To capture the funds for an uncaptured payment"+ "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"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario1-Create payment with confirm true",+ "item": [{- "name": "Payments - Retrieve",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments - 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.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(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -2860,6 +3039,15 @@" },"," );","}",+ "",+ "// Response body should have \"connector_transaction_id\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " },",+ ");",""],"type": "text/javascript"@@ -2867,66 +3055,60 @@}],"request": {- "method": "GET",+ "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,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"01\",\"card_exp_year\":\"35\",\"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\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "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"+ "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": "Scenario4a-Create payment with partial capture",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "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(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "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(\"[POST]::/payments - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -2962,15 +3144,144 @@" );","}","",- "// Response body should have value \"requires_capture\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",+ "",+ "// Response body should have \"connector_transaction_id\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " },",+ ");",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "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"+ },+ "response": []+ }+ ]+ },+ {+ "name": "Scenario2-Create payment with confirm false",+ "item": [+ {+ "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) {}",+ "",+ "// 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.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"requires_payment_method\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -2996,7 +3307,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -3012,20 +3323,20 @@"response": []},{- "name": "Payments - Capture",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type","pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",+ " \"[POST]::/payments/:id/confirm - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -3034,7 +3345,7 @@");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -3057,6 +3368,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -3073,29 +3385,9 @@"// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(6000);",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -3103,9 +3395,38 @@],"type": "text/javascript"}+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }}],"request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },"method": "POST","header": [{@@ -3124,17 +3445,17 @@"language": "json"}},- "raw": "{\"amount_to_capture\":6000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"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\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"},"url": {- "raw": "{{baseUrl}}/payments/:id/capture",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": ["payments",":id",- "capture"+ "confirm"],"variable": [{@@ -3144,7 +3465,7 @@}]},- "description": "To capture the funds for an uncaptured payment"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []},@@ -3207,9 +3528,9 @@"// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'partially_captured'\",",+ " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -3257,7 +3578,7 @@]},{- "name": "Scenario5-Void the payment",+ "name": "Scenario2a-Create payment with confirm false card holder name null","item": [{"name": "Payments - Create",@@ -3315,12 +3636,12 @@" );","}","",- "// Response body should have value \"requires_capture\" for \"status\"",+ "// Response body should have value \"requires_payment_method\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",@@ -3328,6 +3649,15 @@],"type": "text/javascript"}+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }}],"request": {@@ -3349,7 +3679,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -3365,20 +3695,20 @@"response": []},{- "name": "Payments - Cancel",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/cancel - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type","pm.test(",- " \"[POST]::/payments/:id/cancel - Content-Type is application/json\",",+ " \"[POST]::/payments/:id/confirm - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -3387,7 +3717,7 @@");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -3423,12 +3753,12 @@" );","}","",- "// Response body should have value \"cancelled\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"cancelled\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -3436,9 +3766,38 @@],"type": "text/javascript"}+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }}],"request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },"method": "POST","header": [{@@ -3457,17 +3816,17 @@"language": "json"}},- "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"+ "raw": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":null,\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"},"url": {- "raw": "{{baseUrl}}/payments/:id/cancel",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": ["payments",":id",- "cancel"+ "confirm"],"variable": [{@@ -3477,7 +3836,7 @@}]},- "description": "A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []},@@ -3537,12 +3896,12 @@" );","}","",- "// Response body should have value \"cancelled\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'\",",+ " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"cancelled\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -3590,7 +3949,7 @@]},{- "name": "Scenario6-Refund full payment",+ "name": "Scenario2b-Create payment with confirm false card holder name empty","item": [{"name": "Payments - Create",@@ -3648,12 +4007,12 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_payment_method\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",@@ -3661,6 +4020,15 @@],"type": "text/javascript"}+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }}],"request": {@@ -3682,7 +4050,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\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -3698,26 +4066,29 @@"response": []},{- "name": "Payments - Retrieve",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments - 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\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - 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.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -3740,7 +4111,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -3754,113 +4124,23 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );",- "}",- ""+ "}"],"type": "text/javascript"}- }- ],- "request": {- "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"- },- "response": []- },- {- "name": "Refunds - Create",- "event": [{- "listen": "test",+ "listen": "prerequest","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - 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 refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",- " console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"pending\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",""],"type": "text/javascript"@@ -3868,6 +4148,26 @@}],"request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },"method": "POST","header": [{@@ -3886,79 +4186,95 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":6540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"\",\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"},"url": {- "raw": "{{baseUrl}}/refunds",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "refunds"+ "payments",+ ":id",+ "confirm"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "description": "To create a refund against an already processed payment"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []},{- "name": "Refunds - Retrieve",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",+ "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]::/refunds/:id - Content-Type is application/json\", function () {",+ "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 refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// 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 {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\","," );","}","",- "// Response body should have value \"pending\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",+ "// 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 \"6540\" for \"amount\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",+ " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.amount).to.eql(6540);",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );",- "}",- ""+ "}"],"type": "text/javascript"}@@ -3973,30 +4289,36 @@}],"url": {- "raw": "{{baseUrl}}/refunds/:id",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "refunds",+ "payments",":id"],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],"variable": [{"key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "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"},"response": []}]},{- "name": "Scenario6a-Partial refund",+ "name": "Scenario3-Create payment without PMD","item": [{"name": "Payments - Create",@@ -4054,12 +4376,12 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_payment_method\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",@@ -4088,7 +4410,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\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -4104,26 +4426,29 @@"response": []},{- "name": "Payments - Retrieve",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - 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\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - 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.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -4158,11 +4483,10 @@" \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\","," );","}",- "",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },",@@ -4172,30 +4496,67 @@],"type": "text/javascript"}+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }}],"request": {- "method": "GET",+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_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": "{\"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\"}},\"client_secret\":\"{{client_secret}}\"}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": ["payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }+ ":id",+ "confirm"],"variable": [{@@ -4205,64 +4566,72 @@}]},- "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"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []},{- "name": "Refunds - Create",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",+ "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(\"[POST]::/refunds - Content-Type is application/json\", function () {",+ "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 refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// 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 {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\","," );","}","",- "// Response body should have value \"pending\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",+ "// 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 \"540\" for \"amount\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",+ " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.amount).to.eql(540);",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -4273,93 +4642,107 @@}],"request": {- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },"url": {- "raw": "{{baseUrl}}/refunds",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "refunds"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "description": "To create a refund against an already processed payment"+ "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"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario4-Create payment with Manual capture",+ "item": [{- "name": "Refunds - Retrieve",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/:id - Content-Type is application/json\", function () {",+ "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 refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// 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 {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\","," );","}","",- "// Response body should have value \"pending\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",+ "// 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 \"6540\" for \"amount\"",+ "// Response body should have value \"requires_capture\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\","," function () {",- " pm.expect(jsonData.amount).to.eql(540);",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");"," },"," );","}",@@ -4370,51 +4753,64 @@}],"request": {- "method": "GET",+ "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\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ },"url": {- "raw": "{{baseUrl}}/refunds/:id",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }+ "payments"]},- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "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": "Refunds - Create-copy",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - 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/:id/capture - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable",@@ -4423,35 +4819,58 @@" jsonData = pm.response.json();","} catch (e) {}","",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// 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 {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\","," );","}","",- "// Response body should have value \"pending\" for \"status\"",+ "// 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\" while capturing a payment manually","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",+ " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",+ " pm.expect(jsonData.status).to.eql(\"processing\");"," },"," );","}","",- "// Response body should have value \"1000\" for \"amount\"",- "if (jsonData?.status) {",+ "// Response body should have value \"6540\" for \"amount\"",+ "if (jsonData?.amount) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\",",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\","," function () {",- " pm.expect(jsonData.amount).to.eql(1000);",+ " pm.expect(jsonData.amount).to.eql(6540);",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"6000\" for \"amount_received\"",+ "if (jsonData?.amount_received) {",+ " pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(6540);"," },"," );","}",@@ -4480,115 +4899,32 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":1000,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/refunds",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds"- ]+ "raw": "{\"amount_to_capture\":6540,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"},- "description": "To create a refund against an already processed payment"- },- "response": []- },- {- "name": "Refunds - Retrieve-copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",- " console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"pending\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1000);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],"url": {- "raw": "{{baseUrl}}/refunds/:id",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": [- "refunds",- ":id"+ "payments",+ ":id",+ "capture"],"variable": [{"key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "description": "To capture the funds for an uncaptured payment"},"response": []},{- "name": "Payments - Retrieve-copy",+ "name": "Payments - Retrieve","event": [{"listen": "test",@@ -4643,20 +4979,15 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"processing\" for \"status\" while capturing a payment manually","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"processing\");"," },"," );","}",- "",- "// Response body should have \"refunds\"",- "pm.test(\"[POST]::/payments - Content check if 'refunds' exists\", function () {",- " pm.expect(typeof jsonData.refunds !== \"undefined\").to.be.true;",- "});",""],"type": "text/javascript"@@ -4701,7 +5032,7 @@]},{- "name": "Scenario7-Create a mandate and recurring payment",+ "name": "Scenario4a-Create payment with partial capture","item": [{"name": "Payments - Create",@@ -4746,19 +5077,6 @@" );","}","",- "// 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);",@@ -4772,31 +5090,15 @@" );","}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"requires_capture\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");"," },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -4822,7 +5124,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -4838,20 +5140,20 @@"response": []},{- "name": "Payments - Confirm",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type","pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",+ " \"[POST]::/payments/:id/capture - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -4860,7 +5162,7 @@");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -4883,7 +5185,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -4897,24 +5198,35 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"processing\" for \"status\" while partially capturing a payment","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"processing\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"6540\" for \"amount\"",+ "if (jsonData?.amount) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(6540);",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"6000\" for \"amount_received\"",+ "if (jsonData?.amount_received) {",+ " pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(6000);"," },"," );","}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [""],"type": "text/javascript"@@ -4922,26 +5234,6 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -4960,17 +5252,17 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"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\"}},\"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\":7000,\"currency\":\"USD\"}}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ "raw": "{\"amount_to_capture\":6000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": ["payments",":id",- "confirm"+ "capture"],"variable": [{@@ -4980,69 +5272,7 @@}]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"- },- "response": []- },- {- "name": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"+ "description": "To capture the funds for an uncaptured payment"},"response": []},@@ -5089,18 +5319,6 @@" );","}","",- "// 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);",@@ -5114,31 +5332,15 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"processing\" for \"status\" while partially capturing a payment","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " 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;",- " },",- ");",""],"type": "text/javascript"@@ -5179,9 +5381,14 @@"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"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario5-Void the payment",+ "item": [{- "name": "Recurring Payments - Create",+ "name": "Payments - Create","event": [{"listen": "test",@@ -5223,19 +5430,6 @@" );","}","",- "// 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);",@@ -5249,39 +5443,15 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_capture\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");"," },"," );","}",- "",- "// 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;",- " },",- ");",- "",- "// Response body should have \"payment_method_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",- " },",- ");",""],"type": "text/javascript"@@ -5307,7 +5477,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\":\"{{customer_id}}\",\"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,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -5323,26 +5493,29 @@"response": []},{- "name": "Payments - Retrieve-copy",+ "name": "Payments - Cancel","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/cancel - 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\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/cancel - 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.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -5365,7 +5538,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -5379,31 +5551,15 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"cancelled\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"cancelled\");"," },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -5411,27 +5567,35 @@}],"request": {- "method": "GET",+ "method": "POST","header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },{"key": "Accept","value": "application/json"}],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments/:id/cancel","host": ["{{baseUrl}}"],"path": ["payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }+ ":id",+ "cancel"],"variable": [{@@ -5441,36 +5605,31 @@}]},- "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"+ "description": "A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action"},"response": []- }- ]- },- {- "name": "Scenario7a-Manual capture for recurring payments",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "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(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "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(\"[POST]::/payments - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -5493,19 +5652,6 @@" );","}","",- "// 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);",@@ -5519,15 +5665,116 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"cancelled\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"cancelled\");"," },"," );","}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "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"+ },+ "response": []+ }+ ]+ },+ {+ "name": "Scenario6-Refund full payment",+ "item": [+ {+ "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) {}",+ "",+ "// 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.\",",+ " );",+ "}","","// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",@@ -5538,22 +5785,6 @@" },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -5579,7 +5810,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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -5637,6 +5868,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -5659,22 +5891,6 @@" },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -5717,107 +5933,62 @@"response": []},{- "name": "Recurring Payments - Create",+ "name": "Refunds - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/refunds - 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.test(\"[POST]::/refunds - 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);",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);"," console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_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 \"pending\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"pending\");",+ " },"," );","}","",- "// Response body should have value \"requires_capture\" for \"status\"",+ "// Response body should have value \"6540\" for \"amount\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " pm.expect(jsonData.amount).to.eql(6540);"," },"," );","}",- "",- "// 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;",- " },",- ");",- "",- "// Response body should have \"payment_method_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",- " },",- ");",""],"type": "text/javascript"@@ -5843,46 +6014,38 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":6540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments"+ "refunds"]},- "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"+ "description": "To create a refund against an already processed payment"},"response": []},{- "name": "Payments - Capture",+ "name": "Refunds - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",+ "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - 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/:id/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "pm.test(\"[GET]::/refunds/: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",@@ -5891,192 +6054,38 @@" 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 client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);"," console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\","," );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"pending\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"pending\");"," },"," );","}","","// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "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_to_capture\":6540,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/capture",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To capture the funds for an uncaptured payment"- },- "response": []- },- {- "name": "Payments - Retrieve-copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// 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 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'\",",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.amount).to.eql(6540);"," },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -6092,36 +6101,30 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/refunds/:id","host": ["{{baseUrl}}"],"path": [- "payments",+ "refunds",":id"],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{refund_id}}",+ "description": "(Required) unique refund 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"+ "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []}]},{- "name": "Scenario8-Refund recurring payment",+ "name": "Scenario6a-Partial refund","item": [{"name": "Payments - Create",@@ -6166,19 +6169,6 @@" );","}","",- "// 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);",@@ -6201,32 +6191,6 @@" },"," );","}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - 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;",- " },",- ");",""],"type": "text/javascript"@@ -6252,7 +6216,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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -6332,22 +6296,6 @@" },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -6390,117 +6338,62 @@"response": []},{- "name": "Recurring Payments - Create",+ "name": "Refunds - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/refunds - 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.test(\"[POST]::/refunds - 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);",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);"," console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\","," );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"pending\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"pending\");"," },"," );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"540\" for \"amount\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.amount).to.eql(540);"," },"," );","}",- "",- "// 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;",- " },",- ");",- "",- "// Response body should have \"payment_method_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",- " },",- ");",""],"type": "text/javascript"@@ -6526,102 +6419,78 @@"language": "json"}},- "raw": "{\"amount\":6570,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6570,\"customer_id\":\"{{customer_id}}\",\"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,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments"+ "refunds"]},- "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"+ "description": "To create a refund against an already processed payment"},"response": []},{- "name": "Payments - Retrieve-copy",+ "name": "Refunds - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[GET]::/refunds/: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.test(\"[GET]::/refunds/: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);",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);"," console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_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 \"pending\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"pending\");",+ " },"," );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"6540\" for \"amount\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.amount).to.eql(540);"," },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -6637,34 +6506,28 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/refunds/:id","host": ["{{baseUrl}}"],"path": [- "payments",+ "refunds",":id"],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{refund_id}}",+ "description": "(Required) unique refund 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"+ "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []},{- "name": "Refunds - Create",+ "name": "Refunds - Create-copy","event": [{"listen": "test",@@ -6711,12 +6574,12 @@" );","}","",- "// Response body should have value \"6540\" for \"amount\"",+ "// Response body should have value \"1000\" for \"amount\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\","," function () {",- " pm.expect(jsonData.amount).to.eql(6540);",+ " pm.expect(jsonData.amount).to.eql(1000);"," },"," );","}",@@ -6745,7 +6608,7 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":6540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":1000,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {"raw": "{{baseUrl}}/refunds",@@ -6761,7 +6624,7 @@"response": []},{- "name": "Refunds - Retrieve",+ "name": "Refunds - Retrieve-copy","event": [{"listen": "test",@@ -6811,9 +6674,9 @@"// Response body should have value \"6540\" for \"amount\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\","," function () {",- " pm.expect(jsonData.amount).to.eql(6540);",+ " pm.expect(jsonData.amount).to.eql(1000);"," },"," );","}",@@ -6851,67 +6714,218 @@"description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []- }- ]- },- {- "name": "Scenario9-Add card flow",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Retrieve-copy","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "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(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "// 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){}",+ "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);",+ " 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.');",- "};",- "",+ " 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",+ " 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 {{customer_id}}, as jsonData.customer_id is undefined.');",- "};",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {",- " pm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'requires_payment_method'\", function() {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- " })};"+ " 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 \"refunds\"",+ "pm.test(\"[POST]::/payments - Content check if 'refunds' exists\", function () {",+ " pm.expect(typeof jsonData.refunds !== \"undefined\").to.be.true;",+ "});",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "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"+ },+ "response": []+ }+ ]+ },+ {+ "name": "Scenario7-Create a mandate and recurring payment",+ "item": [+ {+ "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) {}",+ "",+ "// 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 \"requires_payment_method\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " },",+ " );",+ "}",+ "",+ "// 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;",+ " },",+ ");",+ ""],"type": "text/javascript"}@@ -6936,7 +6950,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"stripesavecard\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -7074,7 +7088,7 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"on_session\",\"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\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"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\"}},\"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\":7000,\"currency\":\"USD\"}}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"},"url": {"raw": "{{baseUrl}}/payments/:id/confirm",@@ -7161,116 +7175,160 @@"response": []},{- "name": "Save card payments - Create",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "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(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "// 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){}",+ "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);",+ " 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.');",- "};",+ " 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);",+ " 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.');",- "};",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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;",+ " },",+ ");",+ ""],"type": "text/javascript"}}],"request": {- "method": "POST",+ "method": "GET","header": [{- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",+ "key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "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"+ "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"},"response": []},{- "name": "Save card payments - Confirm",+ "name": "Recurring Payments - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",+ "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/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "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/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -7293,6 +7351,19 @@" );","}","",+ "// 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);",@@ -7309,23 +7380,36 @@"// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - 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 value \"cybersource\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'cybersource'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"cybersource\");",- " },",- " );",- "}",+ "// 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;",+ " },",+ ");",+ "",+ "// Response body should have \"payment_method_data\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",+ " },",+ ");",""],"type": "text/javascript"@@ -7333,26 +7417,6 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -7371,32 +7435,23 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\",\"card_cvc\":\"737\"}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "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": "Payments - Retrieve",+ "name": "Payments - Retrieve-copy","event": [{"listen": "test",@@ -7414,17 +7469,17 @@" );","});","",+ "// 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) {}","",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {"," pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",@@ -7451,6 +7506,32 @@" \"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;",+ " },",+ ");",""],"type": "text/javascript"@@ -7466,7 +7547,7 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],@@ -7474,6 +7555,12 @@"payments",":id"],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],"variable": [{"key": "id",@@ -7485,1436 +7572,116 @@"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"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario7a-Manual capture for recurring payments",+ "item": [{- "name": "Refunds - Create",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",+ "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]::/refunds - Content-Type is application/json\", function () {",+ "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 refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// 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 {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id 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": "{\"payment_id\":\"{{payment_id}}\",\"amount\":600,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/refunds",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds"- ]- },- "description": "To create a refund against an already processed payment"- },- "response": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",- " console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario10-Don't Pass CVV for save card flow and verifysuccess payment",- "item": [- {- "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){}",- "",- "// 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"stripesavecard\",\"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://google.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"online\",\"accepted_at\":\"2022-09-10T10:11:12Z\",\"online\":{\"ip_address\":\"123.32.25.123\",\"user_agent\":\"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"- },- "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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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){}",- "",- "// 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card payments - Confirm",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/confirm - 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/:id/confirm - 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 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 \"cybersource\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'cybersource'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"cybersource\");",- " },",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\", function() {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " })};"- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_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": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/confirm",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"- },- "response": []- }- ]- },- {- "name": "Scenario11-Save card payment with manual capture",- "item": [- {- "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){}",- "",- "// 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');",- "};",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}"- ],- "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\":\"adyensavecard\",\"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://google.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"online\",\"accepted_at\":\"2022-09-10T10:11:12Z\",\"online\":{\"ip_address\":\"123.32.25.123\",\"user_agent\":\"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"- },- "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": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// 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 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\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"cybersource\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"0\" for \"amount_capturable\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "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"- },- "response": []- },- {- "name": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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){}",- "",- "// 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card payments - Confirm",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/confirm - 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/:id/confirm - 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 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 \"requires_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- "",- "",- "// Response body should have value \"cybersource\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'cybersource'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"cybersource\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_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": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\",\"card_cvc\":\"7373\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/confirm",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"- },- "response": []- },- {- "name": "Payments - Capture",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - 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/:id/capture - 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 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/capture - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"cybersource\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "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_to_capture\":6540,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/capture",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To capture the funds for an uncaptured payment"- },- "response": []- },- {- "name": "Payments - Retrieve-copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// 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 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\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"cybersource\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6540);",- " },",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\","," );","}","",- "// Response body should have value \"0\" for \"amount_capturable\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",+ "// 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,"," );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "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"- },- "response": []- },- {- "name": "Refunds - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\","," );",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "}","",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// 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 {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\","," );","}","",- "// Response body should have value \"pending\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}","",- "// Response body should have value \"540\" for \"amount\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.amount).to.eql(540);",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}","",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"cybersource\");",- "});",+ "// 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;",+ " },",+ ");",""],"type": "text/javascript"@@ -8940,78 +7707,102 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {- "raw": "{{baseUrl}}/refunds",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "refunds"+ "payments"]},- "description": "To create a refund against an already processed payment"+ "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": "Refunds - Retrieve",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",+ "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]::/refunds/:id - Content-Type is application/json\", function () {",+ "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 refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// 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 {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\","," );","}","",- "// Response body should have value \"pending\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",+ "// 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 \"6540\" for \"amount\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.amount).to.eql(540);",+ " 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;",+ " },",+ ");",""],"type": "text/javascript"@@ -9027,89 +7818,134 @@}],"url": {- "raw": "{{baseUrl}}/refunds/:id",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "refunds",+ "payments",":id"],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],"variable": [{"key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "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"},"response": []- }- ]- },- {- "name": "Scenario12-Zero auth mandates",- "item": [+ },{- "name": "Mandate Payments - Create",+ "name": "Recurring Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",+ "// Validate status 2xx","pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ " 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\");",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );","});","",- "// Validate if response has JSON Body ",+ "// Validate if response has JSON Body","pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {jsonData = pm.response.json();}catch(e){}",+ "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);",+ " 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 {{payment_id}}, as jsonData.payment_id is undefined.');",- "};",+ " 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);",+ " 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.');",- "};",- "",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"requires_capture\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- "})};",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " },",+ " );",+ "}","","// 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;",- "});",+ "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;",- "});",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have \"payment_method_data\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",+ " },",+ ");",""],"type": "text/javascript"@@ -9117,26 +7953,6 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -9155,7 +7971,7 @@"language": "json"}},- "raw": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"John\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"John\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"order_details\":[{\"product_name\":\"Apple iphone 15\",\"quantity\":1,\"amount\":0,\"account_name\":\"transaction_processing\"}],\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {"raw": "{{baseUrl}}/payments",@@ -9171,71 +7987,93 @@"response": []},{- "name": "Payments - Confirm",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/:id/capture - 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\");",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - 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();",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/capture - 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){}",+ "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);",+ " 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 {{mandate_id}}, as jsonData.mandate_id is undefined.');",- "};",+ " 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);",+ " 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.');",- "};",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"processing\" for \"status\" in case of Manual capture for recurring payments","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\", function() {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- "})};",+ " pm.test(",+ " \"[POST]:://payments/:id/capture - 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 value \"6540\" for \"amount\"",+ "if (jsonData?.amount) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(6540);",+ " },",+ " );",+ "}","",- "// 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;",- "});",+ "// Response body should have value \"6000\" for \"amount_received\"",+ "if (jsonData?.amount_received) {",+ " pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(6540);",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -9243,26 +8081,6 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -9272,12 +8090,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "publishable_key",- "value": "pk_snd_8798c6a9114646f8b970b93ad5765ddf",- "type": "text",- "disabled": true}],"body": {@@ -9287,101 +8099,112 @@"language": "json"}},- "raw": "{\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"CLBRW1\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"125.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"multi_use\":{\"amount\":1000,\"currency\":\"USD\",\"start_date\":\"2023-04-21T00:00:00Z\",\"end_date\":\"2023-05-21T00:00:00Z\",\"metadata\":{\"frequency\":\"13\"}}}}}"+ "raw": "{\"amount_to_capture\":6540,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": ["payments",":id",- "confirm"+ "capture"],"variable": [{"key": "id",- "value": "{{payment_id}}"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "description": "To capture the funds for an uncaptured payment"},"response": []},{- "name": "Recurring Payments - Create",+ "name": "Payments - Retrieve-copy","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "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(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "// 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){}",+ "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);",+ " 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 {{mandate_id}}, as jsonData.mandate_id is undefined.');",- "};",+ " 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);",+ " 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.');",- "};",- "",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"processing\" for \"status\" while retrieving a payment captured manually","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\", function() {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- "})};",+ " pm.test(",+ " \"[POST]::/payments/:id - 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;",- "});",+ "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;",- "});",- "",- "// Response body should have \"payment_method_data\"",- "pm.test(\"[POST]::/payments - Content check if 'payment_method_data' exists\", function() {",- " pm.expect((typeof jsonData.payment_method_data !== \"undefined\")).to.be.true;",- "});",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",+ " },",+ ");",""],"type": "text/javascript"@@ -9389,63 +8212,44 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":1000,\"currency\":\"USD\",\"confirm\":true,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://google.com\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"billing\":{\"address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"},\"order_details\":[{\"product_name\":\"Apple iphone 15\",\"quantity\":1,\"amount\":1000,\"account_name\":\"transaction_processing\"}]}"- },"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "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"+ "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"},"response": []}]},{- "name": "Scenario13-Incremental auth",+ "name": "Scenario8-Refund recurring payment","item": [{"name": "Payments - Create",@@ -9454,41 +8258,104 @@"listen": "test","script": {"exec": [- "// Validate status 2xx ",+ "// Validate status 2xx","pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ " 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\");",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );","});","",- "// Validate if response has JSON Body ",+ "// Validate if response has JSON Body","pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ " pm.response.to.have.jsonBody();","});","",- "","// Set response object as internal variable","let jsonData = {};",- "try {jsonData = pm.response.json();}catch(e){}",+ "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);",+ " 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.');",- "};",+ " 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);",+ " 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.');",- "};"+ " 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 - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - 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;",+ " },",+ ");",+ ""],"type": "text/javascript"}@@ -9504,12 +8371,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "Authorization",- "value": "",- "type": "text",- "disabled": true}],"body": {@@ -9519,7 +8380,7 @@"language": "json"}},- "raw": "{\"amount\":1000,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"amount_to_capture\":1000,\"description\":\"Its my first payment request\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"return_url\":\"https://google.com\",\"name\":\"Preetam\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"09\",\"card_exp_year\":\"2027\",\"card_holder_name\":\"\",\"card_cvc\":\"975\"}},\"connector_metadata\":{\"noon\":{\"order_category\":\"pay\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"128.0.0.1\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"PL\",\"first_name\":\"preetam\",\"last_name\":\"revankar\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"PL\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"order_details\":[{\"product_name\":\"Apple iphone 15\",\"quantity\":1,\"amount\":1000,\"account_name\":\"transaction_processing\"}],\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"request_incremental_authorization\":true,\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -9534,60 +8395,6 @@},"response": []},- {- "name": "Incremental Authorization",- "event": [- {- "listen": "test",- "script": {- "exec": [- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'amount' matches '1001'\", function () {",- " // Parse the response JSON",- " var jsonData = pm.response.json();",- "",- " // Check if the 'amount' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].amount).to.eql(1001);",- "});",- "",- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'status' matches 'success'\", function () {",- " // Parse the response JSON",- " var jsonData = pm.response.json();",- "",- " // Check if the 'status' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].status).to.eql(\"success\");",- "});",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":1001}"- },- "url": {- "raw": "{{baseUrl}}/payments/{{payment_id}}/incremental_authorization",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- "{{payment_id}}",- "incremental_authorization"- ]- }- },- "response": []- },{"name": "Payments - Retrieve","event": [@@ -9595,47 +8402,81 @@"listen": "test","script": {"exec": [- "// Validate status 2xx ",+ "// Validate status 2xx","pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ " 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\");",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );","});","",- "// Validate if response has JSON Body ",+ "// Validate if response has JSON Body","pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {jsonData = pm.response.json();}catch(e){}",+ "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);",+ " 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.');",- "};",+ " 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);",+ " 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.');",- "};",- "",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",- "// Response body should have value \"requires_capture\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\", function() {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- "})};"+ " 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;",+ " },",+ ");",+ ""],"type": "text/javascript"}@@ -9650,7 +8491,7 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?expand_attempts=true&force_sync=true",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],@@ -9659,10 +8500,6 @@":id"],"query": [- {- "key": "expand_attempts",- "value": "true"- },{"key": "force_sync","value": "true"@@ -9671,7 +8508,8 @@"variable": [{"key": "id",- "value": "{{payment_id}}"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},@@ -9680,29 +8518,26 @@"response": []},{- "name": "Payments - Capture",+ "name": "Recurring Payments - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",+ "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/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "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/:id/capture - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -9725,6 +8560,19 @@" );","}","",+ "// 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);",@@ -9741,32 +8589,46 @@"// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}","",- "// Response body should have value \"1001\" for \"amount\"",- "if (jsonData?.amount) {",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '1001'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.amount).to.eql(1001);",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}","",- "// Response body should have value \"1001\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '1001'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(1001);",- " },",- " );",- "}",+ "// 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;",+ " },",+ ");",+ "",+ "// Response body should have \"payment_method_data\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",+ " },",+ ");",""],"type": "text/javascript"@@ -9792,17 +8654,130 @@"language": "json"}},- "raw": "{\"amount_to_capture\":1001,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":6570,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6570,\"customer_id\":\"{{customer_id}}\",\"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,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/capture",+ "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": "Payments - Retrieve-copy",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// 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 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;",+ " },",+ ");",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": ["payments",- ":id",- "capture"+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }],"variable": [{@@ -9812,7 +8787,7 @@}]},- "description": "To capture the funds for an uncaptured payment"+ "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"},"response": []},@@ -9864,12 +8839,12 @@" );","}","",- "// Response body should have value \"1001\" for \"amount\"",+ "// Response body should have value \"6540\" for \"amount\"","if (jsonData?.status) {"," pm.test("," \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\","," function () {",- " pm.expect(jsonData.amount).to.eql(1001);",+ " pm.expect(jsonData.amount).to.eql(6540);"," },"," );","}",@@ -9898,7 +8873,7 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":1001,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":6540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {"raw": "{{baseUrl}}/refunds",@@ -9961,12 +8936,12 @@" );","}","",- "// Response body should have value \"1001\" for \"amount\"",+ "// Response body should have value \"6540\" for \"amount\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '1001'\",",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\","," function () {",- " pm.expect(jsonData.amount).to.eql(1001);",+ " pm.expect(jsonData.amount).to.eql(6540);"," },"," );","}",@@ -10008,7 +8983,7 @@]},{- "name": "Scenario14-Incremental auth for mandates",+ "name": "Scenario9-Add card flow","item": [{"name": "Payments - Create",@@ -10032,7 +9007,6 @@" pm.response.to.have.jsonBody();","});","",- "","// Set response object as internal variable","let jsonData = {};","try {jsonData = pm.response.json();}catch(e){}",@@ -10045,13 +9019,27 @@" 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.');",- "};"+ "};",+ "",+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');",+ "};",+ "",+ "// Response body should have value \"requires_payment_method\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'requires_payment_method'\", function() {",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " })};"],"type": "text/javascript"}@@ -10067,12 +9055,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "Authorization",- "value": "",- "type": "text",- "disabled": true}],"body": {@@ -10082,7 +9064,7 @@"language": "json"}},- "raw": "{\"amount\":1000,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"amount_to_capture\":1000,\"description\":\"Its my first payment request\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"return_url\":\"https://google.com\",\"name\":\"Preetam\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"09\",\"card_exp_year\":\"2027\",\"card_holder_name\":\"\",\"card_cvc\":\"975\"}},\"connector_metadata\":{\"noon\":{\"order_category\":\"pay\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"128.0.0.1\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"PL\",\"first_name\":\"preetam\",\"last_name\":\"revankar\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"PL\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"order_details\":[{\"product_name\":\"Apple iphone 15\",\"quantity\":1,\"amount\":1000,\"account_name\":\"transaction_processing\"}],\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"request_incremental_authorization\":true,\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"stripesavecard\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -10098,294 +9080,216 @@"response": []},{- "name": "Incremental Authorization",- "event": [- {- "listen": "test",- "script": {- "exec": [- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'amount' matches '1001'\", function () {",- " // Parse the response JSON",- " var jsonData = pm.response.json();",- "",- " // Check if the 'amount' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].amount).to.eql(1001);",- "});",- "",- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'status' matches 'success'\", function () {",- " // Parse the response JSON",- " var jsonData = pm.response.json();",- "",- " // Check if the 'status' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].status).to.eql(\"success\");",- "});",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":1001}"- },- "url": {- "raw": "{{baseUrl}}/payments/{{payment_id}}/incremental_authorization",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- "{{payment_id}}",- "incremental_authorization"- ]- }- },- "response": []- },- {- "name": "Payments - Retrieve",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/:id/confirm - 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\");",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - 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();",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/confirm - 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){}",+ "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);",+ " 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.');",- "};",+ " 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);",+ " 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.');",- "};",- "",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",- "// Response body should have value \"requires_capture\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\", function() {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- "})};"+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""],"type": "text/javascript"}}],"request": {- "method": "GET",+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_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": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"on_session\",\"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\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?expand_attempts=true&force_sync=true",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": ["payments",- ":id"- ],- "query": [- {- "key": "expand_attempts",- "value": "true"- },- {- "key": "force_sync",- "value": "true"- }+ ":id",+ "confirm"],"variable": [{"key": "id",- "value": "{{payment_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"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []},{- "name": "Payments - Capture",+ "name": "List payment methods for a Customer","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - 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/:id/capture - 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 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.\",",- " );",- "}",+ "// Validate status 2xx ",+ "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});","",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payment_methods/:customer_id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});","",- "// Response body should have value \"1001\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '1001'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1001);",- " },",- " );",- "}",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {jsonData = pm.response.json();}catch(e){}","",- "// Response body should have value \"1001\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '1001'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(1001);",- " },",- " );",- "}",- ""+ "if (jsonData?.customer_payment_methods[0]?.payment_token) {",+ " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",+ " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",+ "}"],"type": "text/javascript"}}],"request": {- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":1001,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/capture",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "capture"+ "customers",+ ":customer_id",+ "payment_methods"],"variable": [{- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "key": "customer_id",+ "value": "{{customer_id}}",+ "description": "//Pass the customer id"}]},- "description": "To capture the funds for an uncaptured payment"+ "description": "To filter and list the applicable payment methods for a particular Customer ID"},"response": []- }- ]- },- {- "name": "Scenario15-Incremental auth with partial capture",- "item": [+ },{- "name": "Payments - Create",+ "name": "Save card payments - Create","event": [{"listen": "test",@@ -10406,7 +9310,6 @@" pm.response.to.have.jsonBody();","});","",- "","// Set response object as internal variable","let jsonData = {};","try {jsonData = pm.response.json();}catch(e){}",@@ -10425,6 +9328,13 @@" 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.');",+ "};",+ "",+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');","};"],"type": "text/javascript"@@ -10432,26 +9342,6 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -10461,12 +9351,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "Authorization",- "value": "",- "type": "text",- "disabled": true}],"body": {@@ -10476,7 +9360,7 @@"language": "json"}},- "raw": "{\"amount\":1000,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"amount_to_capture\":1000,\"description\":\"Its my first payment request\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"return_url\":\"https://google.com\",\"name\":\"Preetam\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"09\",\"card_exp_year\":\"2027\",\"card_holder_name\":\"\",\"card_cvc\":\"975\"}},\"connector_metadata\":{\"noon\":{\"order_category\":\"pay\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"128.0.0.1\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"PL\",\"first_name\":\"preetam\",\"last_name\":\"revankar\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"PL\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"order_details\":[{\"product_name\":\"Apple iphone 15\",\"quantity\":1,\"amount\":1000,\"account_name\":\"transaction_processing\"}],\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"request_incremental_authorization\":true,\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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",@@ -10492,175 +9376,170 @@"response": []},{- "name": "Incremental Authorization",- "event": [- {- "listen": "test",- "script": {- "exec": [- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'amount' matches '1001'\", function () {",- " // Parse the response JSON",- " var jsonData = pm.response.json();",- "",- " // Check if the 'amount' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].amount).to.eql(1001);",- "});",- "",- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'status' matches 'success'\", function () {",- " // Parse the response JSON",- " var jsonData = pm.response.json();",- "",- " // Check if the 'status' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].status).to.eql(\"success\");",- "});",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":1001}"- },- "url": {- "raw": "{{baseUrl}}/payments/{{payment_id}}/incremental_authorization",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- "{{payment_id}}",- "incremental_authorization"- ]- }- },- "response": []- },- {- "name": "Payments - Retrieve",+ "name": "Save card payments - Confirm","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/:id/confirm - 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\");",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - 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();",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/confirm - 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){}",+ "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);",+ " 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.');",- "};",+ " 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);",+ " 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.');",- "};",- "",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",- "// Response body should have value \"requires_capture\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\", function() {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- "})};"+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ "",+ "",+ "// Response body should have value \"cybersource\" for \"connector\"",+ "if (jsonData?.connector) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'cybersource'\",",+ " function () {",+ " pm.expect(jsonData.connector).to.eql(\"cybersource\");",+ " },",+ " );",+ "}",+ ""],"type": "text/javascript"}}],"request": {- "method": "GET",+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_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": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\",\"card_cvc\":\"737\"}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?expand_attempts=true&force_sync=true",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": ["payments",- ":id"- ],- "query": [- {- "key": "expand_attempts",- "value": "true"- },- {- "key": "force_sync",- "value": "true"- }+ ":id",+ "confirm"],"variable": [{"key": "id",- "value": "{{payment_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"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []},{- "name": "Payments - Capture",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",+ "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(",- " \"[POST]::/payments/:id/capture - 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/:id/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "pm.test(\"[GET]::/payments/: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",@@ -10669,6 +9548,11 @@" jsonData = pm.response.json();","} catch (e) {}","",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {"," pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",@@ -10682,6 +9566,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -10694,36 +9579,6 @@" \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\","," );","}",- "",- "// Response body should have value \"partially_captured\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " },",- " );",- "}",- "",- "// Response body should have value \"1001\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '1001'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1001);",- " },",- " );",- "}",- "",- "// Response body should have value \"500\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '500'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(500);",- " },",- " );",- "}",""],"type": "text/javascript"@@ -10731,35 +9586,21 @@}],"request": {- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":500,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/capture",+ "raw": "{{baseUrl}}/payments/:id","host": ["{{baseUrl}}"],"path": ["payments",- ":id",- "capture"+ ":id"],"variable": [{@@ -10769,7 +9610,7 @@}]},- "description": "To capture the funds for an uncaptured payment"+ "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"},"response": []},@@ -10810,26 +9651,6 @@" \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\","," );","}",- "",- "// Response body should have value \"pending\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"500\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '500'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(500);",- " },",- " );",- "}",""],"type": "text/javascript"@@ -10855,7 +9676,7 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":500,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":600,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {"raw": "{{baseUrl}}/refunds",@@ -10907,26 +9728,6 @@" \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\","," );","}",- "",- "// Response body should have value \"pending\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"500\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '500'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(500);",- " },",- " );",- "}",""],"type": "text/javascript"@@ -10965,7 +9766,7 @@]},{- "name": "Scenario16-Verify PML for mandate",+ "name": "Scenario10-Don't Pass CVV for save card flow and verifysuccess payment","item": [{"name": "Payments - Create",@@ -10974,94 +9775,47 @@"listen": "test","script": {"exec": [- "// Validate status 2xx",+ "// Validate status 2xx ","pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ " 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\",",- " );",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","",- "// Validate if response has JSON Body",+ "// Validate if response has JSON Body ","pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "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,",- " );",+ " 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 {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",+ " 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,",- " );",+ " 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 \"requires_confirmation\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",- " },",- " );",- "}",- "",- "// 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;",- " },",- ");",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};","",- "// 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;",- " },",- ");",- ""+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');",+ "};"],"type": "text/javascript"}@@ -11086,7 +9840,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"stripesavecard\",\"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://google.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"online\",\"accepted_at\":\"2022-09-10T10:11:12Z\",\"online\":{\"ip_address\":\"123.32.25.123\",\"user_agent\":\"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -11102,73 +9856,38 @@"response": []},{- "name": "List payment methods for a Merchant",+ "name": "List payment methods for a Customer","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(",- " \"[GET]::/payment_methods/:merchant_id - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",+ "// Validate status 2xx ",+ "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});","","// Validate if response header has matching content-type",- "pm.test(",- " \"[GET]::/payment_methods/:merchant_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) {}",- "",- "",- "// Response body should have value \"new_mandate\" for \"payment_type\"",- "if (jsonData?.payment_type) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'payment_type' matches 'new_mandate'\",",- " function () {",- " pm.expect(jsonData.payment_type).to.eql(\"new_mandate\");",- " },",- " );",- "}",- ""+ "pm.test(\"[GET]::/payment_methods/:customer_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){}",+ "",+ "if (jsonData?.customer_payment_methods[0]?.payment_token) {",+ " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",+ " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",+ "}"],"type": "text/javascript"}}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "GET","header": [{@@ -11177,106 +9896,76 @@}],"url": {- "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "account",+ "customers",+ ":customer_id","payment_methods"],- "query": [+ "variable": [{- "key": "client_secret",- "value": "{{client_secret}}"+ "key": "customer_id",+ "value": "{{customer_id}}",+ "description": "//Pass the customer id"}]},- "description": "To filter and list the applicable payment methods for a particular merchant id."+ "description": "To filter and list the applicable payment methods for a particular Customer ID"},"response": []},{- "name": "Payments - Create-copy",+ "name": "Save card payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",+ "// Validate status 2xx ","pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ " 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\",",- " );",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","",- "// Validate if response has JSON Body",+ "// Validate if response has JSON Body ","pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "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,",- " );",+ " 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.\",",- " );",- "}",+ " 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,",- " );",+ " 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.\",",- " );",- "}",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};","","if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(",- " \"- use {{customer_id}} as collection variable for value\",",- " jsonData.customer_id,",- " );",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);","} else {",- " console.log(",- " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.\",",- " );",- "}",- ""+ " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');",+ "};"],"type": "text/javascript"}@@ -11301,7 +9990,7 @@"language": "json"}},- "raw": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"payment_type\":\"setup_mandate\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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",@@ -11317,23 +10006,20 @@"response": []},{- "name": "List payment methods for a Merchant-copy",+ "name": "Save card payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(",- " \"[GET]::/payment_methods/:merchant_id - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",+ "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});","","// Validate if response header has matching content-type","pm.test(",- " \"[GET]::/payment_methods/:merchant_id - Content-Type is application/json\",",+ " \"[POST]::/payments/:id/confirm - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -11341,23 +10027,58 @@" },",");","",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/confirm - 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.\",",+ " );",+ "}","",- "// Response body should have value \"setup_mandate\" for \"payment_type\"",- "if (jsonData?.payment_type) {",+ "// 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 \"cybersource\" for \"connector\"",+ "if (jsonData?.connector) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'payment_type' matches 'setup_mandate'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'cybersource'\","," function () {",- " pm.expect(jsonData.payment_type).to.eql(\"setup_mandate\");",+ " pm.expect(jsonData.connector).to.eql(\"cybersource\");"," },"," );","}",- ""+ "",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\", function() {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " })};"],"type": "text/javascript"}@@ -11384,37 +10105,52 @@}]},- "method": "GET",+ "method": "POST","header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },{"key": "Accept","value": "application/json"}],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\"}"+ },"url": {- "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "account",- "payment_methods"+ "payments",+ ":id",+ "confirm"],- "query": [+ "variable": [{- "key": "client_secret",- "value": "{{client_secret}}"+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},- "description": "To filter and list the applicable payment methods for a particular merchant id."+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []}]},{- "name": "Scenario17-Revoke mandates",+ "name": "Scenario11-Save card payment with manual capture","item": [{"name": "Payments - Create",@@ -11423,77 +10159,47 @@"listen": "test","script": {"exec": [- "// Validate status 2xx",+ "// Validate status 2xx ","pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ " 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\",",- " );",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","",- "// Validate if response has JSON Body",+ "// Validate if response has JSON Body ","pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "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,",- " );",+ " 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 {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",+ " 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,",- " );",+ " 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.\",",- " );",- "}",+ " 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 - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');",+ "};","","// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",@@ -11503,25 +10209,7 @@" 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;",- " },",- ");",- "",- ""+ "}"],"type": "text/javascript"}@@ -11546,7 +10234,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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"adyensavecard\",\"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://google.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"online\",\"accepted_at\":\"2022-09-10T10:11:12Z\",\"online\":{\"ip_address\":\"123.32.25.123\",\"user_agent\":\"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -11627,21 +10315,40 @@" );","}","",- "// 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;",- " },",- ");",+ "// Validate the connector",+ "pm.test(\"[POST]::/payments - connector\", function () {",+ " pm.expect(jsonData.connector).to.eql(\"cybersource\");",+ "});","",- "// 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;",- " },",- ");",+ "// Response body should have value \"6540\" for \"amount\"",+ "if (jsonData?.amount) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(6540);",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"6000\" for \"amount_received\"",+ "if (jsonData?.amount_received) {",+ " pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(6540);",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"0\" for \"amount_capturable\"",+ "if (jsonData?.amount) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'\",",+ " function () {",+ " pm.expect(jsonData.amount_capturable).to.eql(0);",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -11684,52 +10391,32 @@"response": []},{- "name": "List - Mandates",+ "name": "List payment methods for a Customer","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx ",+ "pm.test(\"[GET]::/payment_methods/:customer_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\",",- " );",+ "pm.test(\"[GET]::/payment_methods/:customer_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) {}",- "",- "",- "// Response body should have value \"active\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'active'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"active\");",- " },",- " );",- "}",- "",- "// 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;",- " },",- ");",- "",- "",+ "try {jsonData = pm.response.json();}catch(e){}","",- ""+ "if (jsonData?.customer_payment_methods[0]?.payment_token) {",+ " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",+ " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",+ "}"],"type": "text/javascript"}@@ -11744,71 +10431,75 @@}],"url": {- "raw": "{{baseUrl}}/mandates/:id",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "mandates",- ":id"+ "customers",+ ":customer_id",+ "payment_methods"],"variable": [{- "key": "id",- "value": "{{mandate_id}}",- "description": "(Required) Unique mandate id"+ "key": "customer_id",+ "value": "{{customer_id}}",+ "description": "//Pass the customer id"}]},- "description": "To list the details of a mandate"+ "description": "To filter and list the applicable payment methods for a particular Customer ID"},"response": []},{- "name": "Revoke - Mandates",+ "name": "Save card payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",+ "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) {}",- "",+ "try {jsonData = pm.response.json();}catch(e){}","",- "// Response body should have value \"revoked\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'revoked'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"revoked\");",- " },",- " );",- "}",+ "// 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.');",+ "};","",- "// 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;",- " },",- ");",+ "// 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.');",+ "};","",- ""+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');",+ "};"],"type": "text/javascript"}@@ -11817,49 +10508,62 @@"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\":false,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ },"url": {- "raw": "{{baseUrl}}/mandates/revoke/:id",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "mandates",- "revoke",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{mandate_id}}"- }+ "payments"]},- "description": "To revoke a mandate registered against a customer"+ "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": "List - Mandates-copy",+ "name": "Save card payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - 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\",",- " );",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - 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/:id/confirm - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable",@@ -11868,27 +10572,52 @@" 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.\",",+ " );",+ "}","",- "// Response body should have value \"revoked\" for \"status\"",+ "// 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 \"requires_capture\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'revoked'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'requires_capture'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"revoked\");",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");"," },"," );","}","",- "// 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 value \"cybersource\" for \"connector\"",+ "if (jsonData?.connector) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'cybersource'\",",+ " function () {",+ " pm.expect(jsonData.connector).to.eql(\"cybersource\");",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -11896,60 +10625,92 @@}],"request": {- "method": "GET",+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_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": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\",\"card_cvc\":\"7373\"}"+ },"url": {- "raw": "{{baseUrl}}/mandates/:id",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "mandates",- ":id"+ "payments",+ ":id",+ "confirm"],"variable": [{"key": "id",- "value": "{{mandate_id}}",- "description": "(Required) Unique mandate id"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},- "description": "To list the details of a mandate"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []- }- ]- },- {- "name": "Scenario18-Create 3ds payment",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - 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\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - 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.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -11972,6 +10733,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -11985,24 +10747,50 @@" );","}","",- "// Response body should have value \"requires_customer_action\" for \"status\"",+ "// Response body should have value \"processing\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'\",",+ " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " pm.expect(jsonData.status).to.eql(\"processing\");"," },"," );","}","",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",+ "// Validate the connector",+ "pm.test(\"[POST]::/payments - connector\", function () {",+ " pm.expect(jsonData.connector).to.eql(\"cybersource\");",+ "});",+ "",+ "// Response body should have value \"6540\" for \"amount\"",+ "if (jsonData?.amount) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(6540);",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"6000\" for \"amount_received\"",+ "if (jsonData?.amount_received) {",+ " pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(6540);",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"6540\" for \"amount_capturable\"",+ "if (jsonData?.amount_capturable) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",+ " function () {",+ " pm.expect(jsonData.amount_capturable).to.eql(6540);",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -12028,23 +10816,32 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"online\",\"accepted_at\":\"2022-09-10T10:11:12Z\",\"online\":{\"ip_address\":\"123.32.25.123\",\"user_agent\":\"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}},\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000001000\",\"card_exp_month\":\"01\",\"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\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount_to_capture\":6540,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "capture"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "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"+ "description": "To capture the funds for an uncaptured payment"},"response": []},{- "name": "Payments - Retrieve",+ "name": "Payments - Retrieve-copy","event": [{"listen": "test",@@ -12099,24 +10896,50 @@" );","}","",- "// Response body should have value \"requires_customer_action\" for \"status\"",+ "// Response body should have value \"processing\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_customer_action'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'processing'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " pm.expect(jsonData.status).to.eql(\"processing\");"," },"," );","}","",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",+ "// Validate the connector",+ "pm.test(\"[POST]::/payments - connector\", function () {",+ " pm.expect(jsonData.connector).to.eql(\"cybersource\");",+ "});",+ "",+ "// Response body should have value \"6540\" for \"amount\"",+ "if (jsonData?.amount) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(6540);",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"6000\" for \"amount_received\"",+ "if (jsonData?.amount_received) {",+ " pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(6540);",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value full amount for \"amount_capturable\"",+ "if (jsonData?.amount) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'\",",+ " function () {",+ " pm.expect(jsonData.amount_capturable).to.eql(jsonData.amount);",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -12157,86 +10980,71 @@"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"},"response": []- }- ]- },- {- "name": "Scenario19-Create 3ds mandate",- "item": [+ },{- "name": "Payments - Create",+ "name": "Refunds - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 4xx",+ "pm.test(\"[POST]::/refunds - Status code is 4xx\", function () {",+ " pm.response.to.have.status(400);","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "pm.test(\"[POST]::/refunds - 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);",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);"," console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,"," );","} else {",+ " pm.collectionVariables.set(\"refund_id\", null);",+ " pm.test(",+ " \"[POST]::/refunds - Content check if 'error.message' matches 'This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured'\",",+ " function () {",+ " pm.expect(jsonData.error.message).to.eql(\"This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured\");",+ " },",+ " );"," console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_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 \"pending\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"pending\");",+ " },"," );","}","",- "// Response body should have value \"requires_customer_action\" for \"status\"",+ "// Response body should have value \"540\" for \"amount\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'\",",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " pm.expect(jsonData.amount).to.eql(540);"," },"," );","}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",""],"type": "text/javascript"@@ -12262,95 +11070,72 @@"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\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000001000\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"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\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments"+ "refunds"]},- "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"+ "description": "To create a refund against an already processed payment"},"response": []},{- "name": "Payments - Retrieve",+ "name": "Refunds - Retrieve","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 4xx",+ "pm.test(\"[POST]::/refunds - Status code is 4xx\", function () {",+ " pm.response.to.have.status(404);","});","","// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ "pm.test(\"[GET]::/refunds/: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.\",",+ "// Response body should have value \"pending\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"pending\");",+ " },"," );","}","",- "// 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,",+ "// Response body should have value \"540\" for \"amount\"",+ "if (jsonData?.status && pm.collectionVariables.get(\"refund_id\") !== null) {",+ " pm.test(",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(540);",+ " },"," );","} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_customer_action\" for \"status\"",- "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_customer_action'\",",+ " \"[POST]::/refunds - Content check if value for 'error.message' matches 'Refund does not exist in our records.'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " pm.expect(jsonData.error.message).to.eql(\"Refund does not exist in our records.\");"," },"," );","}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",""],"type": "text/javascript"@@ -12366,144 +11151,215 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/refunds/:id","host": ["{{baseUrl}}"],"path": [- "payments",+ "refunds",":id"],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{refund_id}}",+ "description": "(Required) unique refund 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"+ "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []}]},{- "name": "Scenario20-Create a mandate without customer acceptance",+ "name": "Scenario12-Zero auth mandates","item": [{- "name": "Payments - Create",+ "name": "Mandate Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",+ "// Validate status 2xx ","pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ " 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\",",- " );",+ " 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 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 \"requires_payment_method\" for \"status\"",+ "if (jsonData?.status) {",+ "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ "})};",+ "",+ "// 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;",+ "});",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{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": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"John\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"John\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"order_details\":[{\"product_name\":\"Apple iphone 15\",\"quantity\":1,\"amount\":0,\"account_name\":\"transaction_processing\"}],\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ },+ "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": "Payments - Confirm",+ "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",+ "// Validate if response has JSON Body ","pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "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,",- " );",+ " 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.\",",- " );",- "}",+ " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",+ "};","",- "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(",- " \"- use {{customer_id}} as collection variable for value\",",- " jsonData.customer_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_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,",- " );",+ " 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.\",",- " );",- "}",+ " 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,",- " );",+ " 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.\",",- " );",- "}",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- " },",- " );",- "}",+ "pm.test(\"[POST]::/payments - 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;",- " },",- ");",+ "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;",- " },",- ");",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_data' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_data !== \"undefined\")).to.be.true;",+ "});",""],"type": "text/javascript"@@ -12511,6 +11367,26 @@}],"request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{api_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },"method": "POST","header": [{@@ -12520,6 +11396,12 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "publishable_key",+ "value": "pk_snd_8798c6a9114646f8b970b93ad5765ddf",+ "type": "text",+ "disabled": true}],"body": {@@ -12529,111 +11411,101 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"customer{{$randomAlphaNumeric}}\",\"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\",\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"mandate_type\":{\"single_use\":{\"amount\":7000,\"currency\":\"USD\"}}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"Juspay Hyperswitch\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"125.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"multi_use\":{\"amount\":1000,\"currency\":\"USD\",\"start_date\":\"2023-04-21T00:00:00Z\",\"end_date\":\"2023-05-21T00:00:00Z\",\"metadata\":{\"frequency\":\"13\"}}}}}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "confirm"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}"+ }]},- "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"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []},{- "name": "Payments - Confirm",+ "name": "Recurring Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "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/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "// 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) {}",+ "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,",- " );",+ " 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.\",",- " );",- "}",+ " 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,",- " );",+ " 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.\",",- " );",- "}",+ " 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,",- " );",+ " 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.\",",- " );",- "}",+ " 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/confirm - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [+ "pm.test(\"[POST]::/payments - 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;",+ "});",+ "",+ "// Response body should have \"payment_method_data\"",+ "pm.test(\"[POST]::/payments - Content check if 'payment_method_data' exists\", function() {",+ " pm.expect((typeof jsonData.payment_method_data !== \"undefined\")).to.be.true;",+ "});",""],"type": "text/javascript"@@ -12646,7 +11518,7 @@"apikey": [{"key": "value",- "value": "{{publishable_key}}",+ "value": "{{api_key}}","type": "string"},{@@ -12679,51 +11551,52 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"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\"}},\"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\":7000,\"currency\":\"USD\"}}},\"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\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ "raw": "{\"amount\":1000,\"currency\":\"USD\",\"confirm\":true,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://google.com\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"billing\":{\"address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"},\"order_details\":[{\"product_name\":\"Apple iphone 15\",\"quantity\":1,\"amount\":1000,\"account_name\":\"transaction_processing\"}]}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "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": "Variation Cases",+ "item": [+ {+ "name": "Scenario10-Refund exceeds amount captured",+ "item": [{- "name": "Payments - Retrieve",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments - 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.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(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -12759,31 +11632,15 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"requires_capture\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");"," },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -12791,61 +11648,63 @@}],"request": {- "method": "GET",+ "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\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "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"+ "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": "Recurring Payments - Create",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - 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\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - 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.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -12868,19 +11727,6 @@" );","}","",- "// 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);",@@ -12894,39 +11740,35 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"processing\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'processing'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " 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;",- " },",- ");",+ "// Response body should have value \"6540\" for \"amount\"",+ "if (jsonData?.amount) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(6540);",+ " },",+ " );",+ "}","",- "// Response body should have \"payment_method_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",- " },",- ");",+ "// Response body should have value \"6000\" for \"amount_received\"",+ "if (jsonData?.amount_received) {",+ " pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(6000);",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -12952,23 +11794,32 @@"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\":\"{{customer_id}}\",\"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,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount_to_capture\":6000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "capture"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "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"+ "description": "To capture the funds for an uncaptured payment"},"response": []},{- "name": "Payments - Retrieve-copy",+ "name": "Payments - Retrieve","event": [{"listen": "test",@@ -13010,7 +11861,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -13024,31 +11874,15 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"processing\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'processing'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " 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;",- " },",- ");",""],"type": "text/javascript"@@ -13089,84 +11923,69 @@"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"},"response": []- }- ]- }- ]- },- {- "name": "Variation Cases",- "item": [- {- "name": "Scenario1-Create payment with Invalid card details",- "item": [+ },{- "name": "Payments - Create(Invalid card number)",+ "name": "Refunds - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",+ "pm.test(\"[POST]::/refunds - 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.test(\"[POST]::/refunds - 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);",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);"," console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_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\");",+ " },"," );","}","",- "// Response body should have \"error\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});",- "",- "// Response body should have value \"connector error\" for \"error type\"",+ "// Response body should have value \"This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured\" for \"error message\"","if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.message' matches 'This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"connector_error\");",+ " pm.expect(jsonData.error.message).to.eql(\"This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured\");"," },"," );","}",@@ -13195,31 +12014,36 @@"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\":\"{{customer_id}}\",\"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\":\"123456\",\"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\":\"united states\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"united states\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":6540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments"+ "refunds"]},- "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"+ "description": "To create a refund against an already processed payment"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario11-Revoke for revoked mandates",+ "item": [{- "name": "Payments - Create(Invalid Exp month)",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// 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",@@ -13253,6 +12077,19 @@" );","}","",+ "// 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);",@@ -13266,20 +12103,42 @@" );","}","",- "// Response body should have \"next_action.redirect_to_url\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}","",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " 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;",+ " },",+ ");",+ "",""],"type": "text/javascript"@@ -13305,7 +12164,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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"01\",\"card_exp_year\":\"2023\",\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -13321,26 +12180,26 @@"response": []},{- "name": "Payments - Create(Invalid Exp Year)",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// 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(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "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(\"[POST]::/payments - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -13376,30 +12235,31 @@" );","}","",- "// Response body should have \"next_action.redirect_to_url\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});",- "",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",+ "// Response body should have value \"Succeeded\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}","",- "// Response body should have value \"connector error\" for \"error message\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Year'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(\"Invalid Expiry Year\");",- " },",- " );",- "}",+ "// 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;",+ " },",+ ");",""],"type": "text/javascript"@@ -13407,109 +12267,84 @@}],"request": {- "method": "POST",+ "method": "GET","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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"2022\",\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"- },"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "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"+ "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"},"response": []},{- "name": "Payments - Create(invalid CVV)",+ "name": "Revoke - Mandates","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// 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(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "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(\"[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 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 - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});","",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",+ "// Response body should have value \"revoked\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'revoked'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"connector\");",+ " pm.expect(jsonData.status).to.eql(\"revoked\");"," },"," );","}",+ "",+ "// 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;",+ " },",+ ");",+ "",""],"type": "text/javascript"@@ -13519,107 +12354,70 @@"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\":\"{{customer_id}}\",\"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\":\"123456\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"12345\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"- },"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/mandates/revoke/:id","host": ["{{baseUrl}}"],"path": [- "payments"+ "mandates",+ "revoke",+ ":id"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{mandate_id}}"+ }]},- "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"+ "description": "To revoke a mandate registered against a customer"},"response": []- }- ]- },- {- "name": "Scenario2-Confirming the payment without PMD",- "item": [+ },{- "name": "Payments - Create",+ "name": "Revoke - Mandates-copy","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 4xx",+ "pm.test(\"[GET]::/payments/:id - 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.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(\"[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 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 \"requires_payment_method\" for \"status\"",- "if (jsonData?.status) {",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );","}",+ "",+ "pm.test(\"[POST]::/payments - Content check if value for 'error.reason' matches 'Mandate has already been revoked\", function () {",+ " pm.expect(jsonData.error.reason).to.eql(\"Mandate has already been revoked\");",+ "});",""],"type": "text/javascript"@@ -13629,61 +12427,58 @@"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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"- },"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/mandates/revoke/:id","host": ["{{baseUrl}}"],"path": [- "payments"+ "mandates",+ "revoke",+ ":id"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{mandate_id}}"+ }]},- "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"+ "description": "To revoke a mandate registered against a customer"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario12-Recurring payment for revoked mandates",+ "item": [{- "name": "Payments - Confirm",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// 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/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "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/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -13706,6 +12501,19 @@" );","}","",+ "// 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);",@@ -13719,32 +12527,41 @@" );","}","",- "// 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 \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}","",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [+ "",+ "// 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;",+ " },",+ ");",""],"type": "text/javascript"@@ -13752,26 +12569,6 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -13790,100 +12587,65 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\"}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"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\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "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": "Scenario3-Capture greater amount",- "item": [+ },{- "name": "Payments - Create",+ "name": "Revoke - Mandates","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "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(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "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(\"[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 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 \"requires_capture\" for \"status\"",+ "// Response body should have value \"revoked\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'revoked'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " pm.expect(jsonData.status).to.eql(\"revoked\");"," },"," );","}",+ "",+ "// 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;",+ " },",+ ");",+ "",""],"type": "text/javascript"@@ -13893,61 +12655,53 @@"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\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"- },"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/mandates/revoke/:id","host": ["{{baseUrl}}"],"path": [- "payments"+ "mandates",+ "revoke",+ ":id"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{mandate_id}}"+ }]},- "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"+ "description": "To revoke a mandate registered against a customer"},"response": []},{- "name": "Payments - Capture",+ "name": "Recurring Payments - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 4xx\", function () {",+ "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/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "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/:id/capture - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -13957,19 +12711,6 @@" 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 client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -13983,23 +12724,20 @@" );","}","",- "// 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 \"connector error\" for \"error type\"","if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {"," pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );","}",+ "",+ "pm.test(\"[POST]::/payments - Content check if value for 'error.message' matches 'Mandate is not active\", function () {",+ " pm.expect(jsonData.error.message).to.eql(\"mandate is not active\");",+ "});",+ "",""],"type": "text/javascript"@@ -14025,27 +12763,18 @@"language": "json"}},- "raw": "{\"amount_to_capture\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/capture",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "description": "To capture the funds for an uncaptured payment"+ "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": []},@@ -14092,6 +12821,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -14105,15 +12835,31 @@" );","}","",- "// Response body should have value \"requires_capture\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " 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;",+ " },",+ ");",""],"type": "text/javascript"@@ -14158,7 +12904,7 @@]},{- "name": "Scenario4-Capture the succeeded payment",+ "name": "Scenario13-Setup_future_usage is off_session for normal payments","item": [{"name": "Payments - Create",@@ -14216,12 +12962,12 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_payment_method\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",@@ -14229,118 +12975,11 @@],"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\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"- },- "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": "Payments - Capture",- "event": [{- "listen": "test",+ "listen": "prerequest","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - 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/:id/capture - 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 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 \"connector error\" 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\");",- " },",- " );",- "}",""],"type": "text/javascript"@@ -14366,34 +13005,25 @@"language": "json"}},- "raw": "{\"amount_to_capture\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"customer_{{$randomAlphaNumeric}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"setup_future_usage\":\"off_session\",\"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\"}},\"return_url\":\"https://duck.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {- "raw": "{{baseUrl}}/payments/:id/capture",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ ],+ "path": [+ "payments"]},- "description": "To capture the funds for an uncaptured payment"+ "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": "Scenario5-Void the success_slash_failure payment",+ "name": "Scenario14-Setup_future_usage is on_session for mandates payments -confirm false","item": [{"name": "Payments - Create",@@ -14438,6 +13068,19 @@" );","}","",+ "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id",+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(",+ " \"- use {{customer_id}} as collection variable for value\",",+ " jsonData.customer_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_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);",@@ -14451,12 +13094,12 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_payment_method\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",@@ -14464,6 +13107,15 @@],"type": "text/javascript"}+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }}],"request": {@@ -14485,7 +13137,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\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"customer{{$randomAlphaNumeric}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -14501,20 +13153,20 @@"response": []},{- "name": "Payments - Cancel",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/cancel - Status code is 4xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - Status code is 4xx\", function () {"," pm.response.to.be.error;","});","","// Validate if response header has matching content-type","pm.test(",- " \"[POST]::/payments/:id/cancel - Content-Type is application/json\",",+ " \"[POST]::/payments/:id/confirm - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -14523,7 +13175,7 @@");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -14546,6 +13198,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -14559,23 +13212,31 @@" );","}","",- "// 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 \"connector error\" for \"error type\"","if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {"," pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );","}",+ "",+ "pm.test(\"[POST]::/payments - Content check if value for 'error.message' matches 'setup_future_usage` cannot be `off_session` for normal payments\", function () {",+ " pm.expect(jsonData.error.message).to.eql(\"`setup_future_usage` must be `off_session` for mandates\");",+ "});",+ "",+ "",+ "",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -14583,6 +13244,26 @@}],"request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },"method": "POST","header": [{@@ -14601,17 +13282,17 @@"language": "json"}},- "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"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\"}},\"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\":7000,\"currency\":\"USD\"}}},\"setup_future_usage\":\"on_session\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"},"url": {- "raw": "{{baseUrl}}/payments/:id/cancel",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": ["payments",":id",- "cancel"+ "confirm"],"variable": [{@@ -14621,14 +13302,14 @@}]},- "description": "A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []}]},{- "name": "Scenario7-Refund exceeds amount",+ "name": "Scenario15-Setup_future_usage is null for normal payments","item": [{"name": "Payments - Create",@@ -14673,6 +13354,19 @@" );","}","",+ "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id",+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(",+ " \"- use {{customer_id}} as collection variable for value\",",+ " jsonData.customer_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_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);",@@ -14686,12 +13380,12 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_payment_method\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",@@ -14699,6 +13393,15 @@],"type": "text/javascript"}+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }}],"request": {@@ -14720,7 +13423,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\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"customer{{$randomAlphaNumeric}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -14736,26 +13439,29 @@"response": []},{- "name": "Payments - Retrieve",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - 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\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - 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.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -14778,6 +13484,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -14799,7 +13506,15 @@" pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );",- "}",+ "}"+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -14807,27 +13522,55 @@}],"request": {- "method": "GET",+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_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": "{\"client_secret\":\"{{client_secret}}\",\"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\"}},\"setup_future_usage\":null,\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": ["payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }+ ":id",+ "confirm"],"variable": [{@@ -14837,109 +13580,74 @@}]},- "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"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []},{- "name": "Refunds - Create",+ "name": "List payment methods for a Customer","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/refunds - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// Validate status 2xx ",+ "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",+ "pm.test(\"[GET]::/payment_methods/:customer_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 refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",- " console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id 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;",- " },",- ");",+ "try {jsonData = pm.response.json();}catch(e){}","",- "// Response body should have value \"connector error\" 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\");",- " },",- " );",- "}",- ""+ "pm.test(\"[GET]::/payment_methods/:customer_id Check if card not stored in the locker \", function () {",+ " var jsonData = pm.response.json();",+ " pm.expect(jsonData.customer_payment_methods).to.be.an('array').that.is.empty;",+ "});"],"type": "text/javascript"}}],"request": {- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":7000,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },"url": {- "raw": "{{baseUrl}}/refunds",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "refunds"+ "customers",+ ":customer_id",+ "payment_methods"+ ],+ "variable": [+ {+ "key": "customer_id",+ "value": "{{customer_id}}",+ "description": "//Pass the customer id"+ }]},- "description": "To create a refund against an already processed payment"+ "description": "To filter and list the applicable payment methods for a particular Customer ID"},"response": []}]},{- "name": "Scenario8-Refund for unsuccessful payment",+ "name": "Scenario6-Refund exceeds amount","item": [{"name": "Payments - Create",@@ -14997,12 +13705,12 @@" );","}","",- "// Response body should have value \"requires_confirmation\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -15031,7 +13739,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -15102,12 +13810,12 @@" );","}","",- "// Response body should have value \"requires_confirmation\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -15198,7 +13906,7 @@" },",");","",- "// Response body should have value \"invalid_request\" for \"error type\"",+ "// Response body should have value \"connector error\" for \"error type\"","if (jsonData?.error?.type) {"," pm.test("," \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",@@ -15232,7 +13940,7 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":7000,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {"raw": "{{baseUrl}}/refunds",@@ -15250,7 +13958,7 @@]},{- "name": "Scenario9-Create a recurring payment with greater mandate amount",+ "name": "Scenario7-Refund for unsuccessful payment","item": [{"name": "Payments - Create",@@ -15295,19 +14003,6 @@" );","}","",- "// 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);",@@ -15321,41 +14016,15 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_confirmation\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");"," },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -15381,7 +14050,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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"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\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -15452,31 +14121,15 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"requires_confirmation\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");"," },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -15513,206 +14166,65 @@"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"- },- "response": []- },- {- "name": "Recurring Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// 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\");",- " },",- " );",- "}",- ""- ],- "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\":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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },- "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": "Scenario10-Manual multiple capture",- "item": [+ },+ "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"+ },+ "response": []+ },{- "name": "Payments - Create",+ "name": "Refunds - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 5xx",- "pm.test(\"[POST]::/payments - Status code is 5xx\", function () {",+ "// Validate status 4xx",+ "pm.test(\"[POST]::/refunds - 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.test(\"[POST]::/refunds - 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);",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);"," console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_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 \"connector error\" for \"error type\"",+ "// 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 - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\","," function () {"," pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );",- "","}",""],@@ -15739,25 +14251,25 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual_multiple\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments"+ "refunds"]},- "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"+ "description": "To create a refund against an already processed payment"},"response": []}]},{- "name": "Scenario11-Refund exceeds amount captured",+ "name": "Scenario8-Create a recurring payment with greater mandate amount","item": [{"name": "Payments - Create",@@ -15802,6 +14314,19 @@" );","}","",+ "// 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);",@@ -15815,15 +14340,41 @@" );","}","",- "// Response body should have value \"requires_capture\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - 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;",+ " },",+ ");",""],"type": "text/javascript"@@ -15849,7 +14400,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"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\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -15865,29 +14416,26 @@"response": []},{- "name": "Payments - Capture",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",+ "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(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "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(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -15923,35 +14471,31 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}","",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",+ "// 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 value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6000);",- " },",- " );",- "}",+ "// 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;",+ " },",+ ");",""],"type": "text/javascript"@@ -15959,35 +14503,27 @@}],"request": {- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":6000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/capture",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": ["payments",- ":id",- "capture"+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }],"variable": [{@@ -15997,31 +14533,31 @@}]},- "description": "To capture the funds for an uncaptured payment"+ "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"},"response": []},{- "name": "Payments - Retrieve",+ "name": "Recurring Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ "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(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -16044,6 +14580,19 @@" );","}","",+ "// 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);",@@ -16057,12 +14606,20 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",- "if (jsonData?.status) {",+ "// 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 - Content check if value for 'status' matches 'partially_captured'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );","}",@@ -16073,104 +14630,108 @@}],"request": {- "method": "GET",+ "method": "POST","header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },{"key": "Accept","value": "application/json"}],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"}+ },+ "raw": "{\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments",+ "host": [+ "{{baseUrl}}"],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "path": [+ "payments"]},- "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"+ "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": "Scenario9-Manual multiple capture",+ "item": [{- "name": "Refunds - Create",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/refunds - Status code is 4xx\", function () {",+ "// Validate status 5xx",+ "pm.test(\"[POST]::/payments - Status code is 5xx\", function () {"," pm.response.to.be.error;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",+ "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 refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// 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 {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id 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\");",- " },",+ "// 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 \"The refund amount exceeds the amount captured\" for \"error message\"",+ "// Response body should have value \"connector error\" for \"error type\"","if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.message' matches 'The refund amount exceeds the amount captured'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {",- " pm.expect(jsonData.error.message).to.eql(\"The refund amount exceeds the amount captured\");",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );",+ "","}",""],@@ -16197,36 +14758,36 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":6540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual_multiple\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {- "raw": "{{baseUrl}}/refunds",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "refunds"+ "payments"]},- "description": "To create a refund against an already processed payment"+ "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": "Scenario12-Revoke for revoked mandates",+ "name": "Scenario1-Create payment with Invalid card details","item": [{- "name": "Payments - Create",+ "name": "Payments - Create(Invalid card number)","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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",@@ -16260,19 +14821,6 @@" );","}","",- "// 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);",@@ -16286,42 +14834,20 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",+ "// Response body should have \"error\"",+ "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ "});","",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.error.type).to.eql(\"connector_error\");"," },"," );","}",- "",- "// 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;",- " },",- ");",- "",""],"type": "text/javascript"@@ -16347,7 +14873,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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"123456\",\"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\":\"united states\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"united states\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -16363,26 +14889,26 @@"response": []},{- "name": "Payments - Retrieve",+ "name": "Payments - Create(Invalid Exp month)","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ "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(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -16418,31 +14944,20 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",- "if (jsonData?.status) {",+ "// Response body should have \"next_action.redirect_to_url\"",+ "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ "});",+ "",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -16450,84 +14965,119 @@}],"request": {- "method": "GET",+ "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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"01\",\"card_exp_year\":\"2023\",\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "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"+ "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": "Revoke - Mandates",+ "name": "Payments - Create(Invalid Exp Year)","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ "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.\",",+ " );",+ "}","",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "// 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 \"next_action.redirect_to_url\"",+ "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ "});","",- "// Response body should have value \"revoked\" for \"status\"",- "if (jsonData?.status) {",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'revoked'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"revoked\");",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );","}","",- "// 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 value \"connector error\" for \"error message\"",+ "if (jsonData?.error?.message) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Year'\",",+ " function () {",+ " pm.expect(jsonData.error.message).to.eql(\"Invalid Expiry Year\");",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -16537,70 +15087,107 @@"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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"2022\",\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ },"url": {- "raw": "{{baseUrl}}/mandates/revoke/:id",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "mandates",- "revoke",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{mandate_id}}"- }+ "payments"]},- "description": "To revoke a mandate registered against a customer"+ "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": "Revoke - Mandates-copy",+ "name": "Payments - Create(invalid CVV)","event": [{"listen": "test","script": {"exec": ["// Validate status 4xx",- "pm.test(\"[GET]::/payments/:id - Status code is 4xx\", function () {",+ "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {"," pm.response.to.be.error;","});","","// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ "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 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 - Content check if 'error' exists\", function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ "});",+ "","// Response body should have value \"connector error\" for \"error type\"","if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.error.type).to.eql(\"connector\");"," },"," );","}",- "",- "pm.test(\"[POST]::/payments - Content check if value for 'error.reason' matches 'Mandate has already been revoked\", function () {",- " pm.expect(jsonData.error.reason).to.eql(\"Mandate has already been revoked\");",- "});",""],"type": "text/javascript"@@ -16610,36 +15197,41 @@"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\":\"{{customer_id}}\",\"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\":\"123456\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"12345\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ },"url": {- "raw": "{{baseUrl}}/mandates/revoke/:id",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "mandates",- "revoke",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{mandate_id}}"- }+ "payments"]},- "description": "To revoke a mandate registered against a customer"+ "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": "Scenario13-Recurring payment for revoked mandates",+ "name": "Scenario2-Confirming the payment without PMD","item": [{"name": "Payments - Create",@@ -16684,19 +15276,6 @@" );","}","",- "// 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);",@@ -16710,41 +15289,15 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"requires_payment_method\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",- "",- "// 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;",- " },",- ");",""],"type": "text/javascript"@@ -16770,7 +15323,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\":\"{{customer_id}}\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":7000,\"currency\":\"USD\"}}},\"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\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -16786,22 +15339,30 @@"response": []},{- "name": "Revoke - Mandates",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - 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/:id/confirm - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable",@@ -16810,25 +15371,58 @@" 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.\",",+ " );",+ "}","",- "// Response body should have value \"revoked\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'revoked'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"revoked\");",- " },",+ "// 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 \"mandate_id\"",+ "// Response body should have \"error\"","pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",+ " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\","," function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;"," },",");","",+ "// Response body should have value \"connector error\" 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\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -16836,44 +15430,83 @@}],"request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_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": "{\"client_secret\":\"{{client_secret}}\"}"+ },"url": {- "raw": "{{baseUrl}}/mandates/revoke/:id",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "mandates",- "revoke",- ":id"+ "payments",+ ":id",+ "confirm"],"variable": [{"key": "id",- "value": "{{mandate_id}}"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},- "description": "To revoke a mandate registered against a customer"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario3-Capture greater amount",+ "item": [{- "name": "Recurring Payments - Create",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// 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",@@ -16894,6 +15527,19 @@" 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 client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -16907,20 +15553,15 @@" );","}","",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",+ "// Response body should have value \"requires_capture\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");"," },"," );","}",- "",- "pm.test(\"[POST]::/payments - Content check if value for 'error.message' matches 'Mandate is not active\", function () {",- " pm.expect(jsonData.error.message).to.eql(\"mandate is not active\");",- "});",- "",""],"type": "text/javascript"@@ -16946,7 +15587,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\":\"{{customer_id}}\",\"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,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -16962,26 +15603,29 @@"response": []},{- "name": "Payments - Retrieve",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 4xx",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 4xx\", function () {",+ " pm.response.to.be.error;","});","","// 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\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - 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.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -17004,7 +15648,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -17018,31 +15661,23 @@" );","}","",- "// 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\"",+ "// Response body should have \"error\"","pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",+ " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\","," function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",+ " pm.expect(typeof jsonData.error !== \"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;",- " },",- ");",+ "// Response body should have value \"connector error\" 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\");",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -17050,27 +15685,35 @@}],"request": {- "method": "GET",+ "method": "POST","header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },{"key": "Accept","value": "application/json"}],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"amount_to_capture\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": ["payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }+ ":id",+ "capture"],"variable": [{@@ -17080,36 +15723,31 @@}]},- "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"+ "description": "To capture the funds for an uncaptured payment"},"response": []- }- ]- },- {- "name": "Scenario14-Setup_future_usage is off_session for normal payments",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "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(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "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(\"[POST]::/payments - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -17145,12 +15783,12 @@" );","}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"requires_capture\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");"," },"," );","}",@@ -17158,55 +15796,47 @@],"type": "text/javascript"}- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }}],"request": {- "method": "POST",+ "method": "GET","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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"customer_{{$randomAlphaNumeric}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"setup_future_usage\":\"off_session\",\"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\"}},\"return_url\":\"https://duck.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"- },"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "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"+ "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"},"response": []}]},{- "name": "Scenario15-Setup_future_usage is on_session for mandates payments -confirm false",+ "name": "Scenario4-Capture the succeeded payment","item": [{"name": "Payments - Create",@@ -17251,19 +15881,6 @@" );","}","",- "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(",- " \"- use {{customer_id}} as collection variable for value\",",- " jsonData.customer_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_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);",@@ -17277,12 +15894,12 @@" );","}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -17290,15 +15907,6 @@],"type": "text/javascript"}- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }}],"request": {@@ -17320,7 +15928,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"customer{{$randomAlphaNumeric}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -17336,20 +15944,20 @@"response": []},{- "name": "Payments - Confirm",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": ["// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 4xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 4xx\", function () {"," pm.response.to.be.error;","});","","// Validate if response header has matching content-type","pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",+ " \"[POST]::/payments/:id/capture - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -17358,7 +15966,7 @@");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -17381,7 +15989,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -17395,31 +16002,23 @@" );","}","",+ "// 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 \"connector error\" for \"error type\"","if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\","," function () {"," pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );","}",- "",- "pm.test(\"[POST]::/payments - Content check if value for 'error.message' matches 'setup_future_usage` cannot be `off_session` for normal payments\", function () {",- " pm.expect(jsonData.error.message).to.eql(\"`setup_future_usage` must be `off_session` for mandates\");",- "});",- "",- "",- "",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [""],"type": "text/javascript"@@ -17427,26 +16026,6 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -17465,17 +16044,17 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"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\"}},\"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\":7000,\"currency\":\"USD\"}}},\"setup_future_usage\":\"on_session\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ "raw": "{\"amount_to_capture\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": ["payments",":id",- "confirm"+ "capture"],"variable": [{@@ -17485,14 +16064,14 @@}]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "description": "To capture the funds for an uncaptured payment"},"response": []}]},{- "name": "Scenario16-Setup_future_usage is null for normal payments",+ "name": "Scenario5-Void the success_slash_failure payment","item": [{"name": "Payments - Create",@@ -17537,19 +16116,6 @@" );","}","",- "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(",- " \"- use {{customer_id}} as collection variable for value\",",- " jsonData.customer_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_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);",@@ -17563,12 +16129,12 @@" );","}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -17576,15 +16142,6 @@],"type": "text/javascript"}- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }}],"request": {@@ -17606,7 +16163,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"customer{{$randomAlphaNumeric}}\",\"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\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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\":\"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\":\"likhin\",\"last_name\":\"bopanna\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"likhin\",\"last_name\":\"bopanna\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -17622,20 +16179,20 @@"response": []},{- "name": "Payments - Confirm",+ "name": "Payments - Cancel","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 4xx",+ "pm.test(\"[POST]::/payments/:id/cancel - Status code is 4xx\", function () {",+ " pm.response.to.be.error;","});","","// Validate if response header has matching content-type","pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",+ " \"[POST]::/payments/:id/cancel - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -17644,7 +16201,7 @@");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -17667,7 +16224,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -17681,23 +16237,23 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",- "if (jsonData?.status) {",+ "// 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 \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );",- "}"- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [+ "}",""],"type": "text/javascript"@@ -17705,26 +16261,6 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -17743,17 +16279,17 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"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\"}},\"setup_future_usage\":null,\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/:id/cancel","host": ["{{baseUrl}}"],"path": ["payments",":id",- "confirm"+ "cancel"],"variable": [{@@ -17763,67 +16299,7 @@}]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"- },- "response": []- },- {- "name": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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.test(\"[GET]::/payment_methods/:customer_id Check if card not stored in the locker \", function () {",- " var jsonData = pm.response.json();",- " pm.expect(jsonData.customer_payment_methods).to.be.an('array').that.is.empty;",- "});"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"+ "description": "A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action"},"response": []}diff --git a/postman/collection-json/nmi.postman_collection.json b/postman/collection-json/nmi.postman_collection.jsonindex 4e75f9f57e..76c1cb3ac4 100644--- a/postman/collection-json/nmi.postman_collection.json+++ b/postman/collection-json/nmi.postman_collection.json@@ -12432,7 +12432,7 @@" 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\");",+ " pm.expect(jsonData.error.reason).to.eql(\"credit mandate payment is not supported by nmi\");"," },"," );","}"diff --git a/postman/collection-json/trustpay.postman_collection.json b/postman/collection-json/trustpay.postman_collection.jsonindex 923e40a677..6e743a43f0 100644--- a/postman/collection-json/trustpay.postman_collection.json+++ b/postman/collection-json/trustpay.postman_collection.json@@ -497,7 +497,16 @@" \"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 - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}"],"type": "text/javascript"}@@ -614,7 +623,16 @@" \"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\");",+ " },",+ " );",+ "}"],"type": "text/javascript"}@@ -652,6 +670,18 @@{"name": "Refunds - Create","event": [+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ "// Add a delay of 10 seconds",+ "setTimeout(function () {",+ " console.log(\"Delay of 10 seconds completed.\");",+ "}, 10000);"+ ],+ "type": "text/javascript"+ }+ },{"listen": "test","script": {@@ -686,6 +716,26 @@" \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\","," );","}",+ "",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"600\" for \"amount\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '600'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(600);",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -763,6 +813,26 @@" \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\","," );","}",+ "",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"600\" for \"amount\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '600'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(600);",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -2838,8 +2908,7 @@" pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );",- "}",- ""+ "}"],"type": "text/javascript"}@@ -2883,6 +2952,18 @@{"name": "Refunds - Create","event": [+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ "// Add a delay of 10 seconds",+ "setTimeout(function () {",+ " console.log(\"Delay of 10 seconds completed.\");",+ "}, 10000);"+ ],+ "type": "text/javascript"+ }+ },{"listen": "test","script": {