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-actionsa49a34af6c04
diff --git a/postman/collection-json/cybersource.postman_collection.json b/postman/collection-json/cybersource.postman_collection.jsonindex 60c4287e17..ace9b2bb41 100644--- a/postman/collection-json/cybersource.postman_collection.json+++ b/postman/collection-json/cybersource.postman_collection.json@@ -4,10 +4,6 @@"listen": "prerequest","script": {"exec": [- "pm.request.headers.add({",- " key: 'x-feature',",- " value: 'router_custom'",- "});",""],"type": "text/javascript"@@ -861,66 +857,82 @@"name": "Happy Cases","item": [{- "name": "Scenario12- Zero auth mandates",+ "name": "Scenario1-Create payment with confirm true","item": [{- "name": "Mandate Payments - Create",+ "name": "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 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\");",- "})};",- "",- "// 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 value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}","",- "// 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 \"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"@@ -928,26 +940,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": [{@@ -957,6 +949,11 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "x-feature",+ "value": "router-custom",+ "type": "text"}],"body": {@@ -966,7 +963,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\":\"8056594427\",\"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\":\"8056594427\",\"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,\"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\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -982,71 +979,79 @@"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.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 \"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;",- "});",+ " 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_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 \"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"@@ -1054,151 +1059,119 @@}],"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"- },- {- "key": "x-feature",- "value": "router-custom",- "type": "text",- "disabled": true- },- {- "key": "publishable_key",- "value": "pk_snd_8798c6a9114646f8b970b93ad5765ddf",- "type": "text",- "disabled": true}],- "body": {- "mode": "raw",- "options": {- "raw": {- "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\"}}}}}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": ["payments",- ":id",- "confirm"+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }],"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 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",+ }+ ]+ },+ {+ "name": "Scenario2-Create payment with confirm false",+ "item": [+ {+ "name": "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);",- "} 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 \"requires_payment_method\" 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;",- "});",- "",- "// 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 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"@@ -1206,26 +1179,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": [{@@ -1244,7 +1197,7 @@"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\":\"8056594427\",\"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\":\"8056594427\",\"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\"}]}"+ "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",@@ -1258,60 +1211,112 @@"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 Incremental auth",- "item": [+ },{- "name": "Payments-Create",+ "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 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 - 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 - 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 \"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": [+ ""],"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": [{@@ -1321,24 +1326,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "x-feature",- "value": "router-custom",- "type": "text",- "disabled": true- },- {- "key": "Authorization",- "value": "",- "type": "text",- "disabled": true- },- {- "key": "x-feature",- "value": "integ-custom",- "type": "text",- "disabled": true}],"body": {@@ -1348,72 +1335,27 @@"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\":\"8056594427\",\"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\":\"8056594427\",\"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": "{\"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",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "confirm"+ ],+ "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"- },- "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"- ]- }+ "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": []},@@ -1424,47 +1366,65 @@"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\");",+ " },",+ " );",+ "}",+ ""],"type": "text/javascript"}@@ -1476,16 +1436,10 @@{"key": "Accept","value": "application/json"- },- {- "key": "x-feature",- "value": "router-custom",- "type": "text",- "disabled": true}],"url": {- "raw": "{{baseUrl}}/payments/:id?expand_attempts=true&force_sync=true",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],@@ -1494,10 +1448,6 @@":id"],"query": [- {- "key": "expand_attempts",- "value": "true"- },{"key": "force_sync","value": "true"@@ -1506,38 +1456,41 @@"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"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario2a-Create payment with confirm false card holder name null",+ "item": [{- "name": "Payments - Capture",+ "name": "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();","});","",@@ -1573,32 +1526,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/:id/capture - 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) {",- " 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 \"1001\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '1001'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(1001);",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",@@ -1606,6 +1539,15 @@],"type": "text/javascript"}+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }}],"request": {@@ -1627,47 +1569,46 @@"language": "json"}},- "raw": "{\"amount_to_capture\":1001,\"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_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/: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": []},{- "name": "Refunds - Create",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/refunds - 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]::/refunds - 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",@@ -1676,35 +1617,38 @@" 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 \"1001\" 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/confirm - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.amount).to.eql(1001);",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -1712,9 +1656,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": [{@@ -1733,75 +1706,92 @@"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_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}}/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 \"1001\" for \"amount\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '1001'\",",+ " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.amount).to.eql(1001);",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -1820,73 +1810,112 @@}],"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": "Scenario14 Incremental auth for mandates",+ "name": "Scenario2b-Create payment with confirm false card holder name empty","item": [{- "name": "Payments-Create",+ "name": "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 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\"",+ "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"}@@ -1902,24 +1931,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "x-feature",- "value": "router-custom",- "type": "text",- "disabled": true- },- {- "key": "Authorization",- "value": "",- "type": "text",- "disabled": true- },- {- "key": "x-feature",- "value": "integ-custom",- "type": "text",- "disabled": true}],"body": {@@ -1929,7 +1940,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\":\"8056594427\",\"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\":\"8056594427\",\"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://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",@@ -1945,180 +1956,171 @@"response": []},{- "name": "Incremental Authorization",+ "name": "Payments - Confirm","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);",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","",- "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();",+ "// 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\",",+ " );",+ " },",+ ");","",- " // 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": [- {- "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();",+ "// 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": "Accept",+ "key": "Content-Type","value": "application/json"},{- "key": "x-feature",- "value": "router-custom",- "type": "text",- "disabled": true+ "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\":\"\",\"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?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\",",- " );",- " },",- ");",+ "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();","});","",@@ -2157,68 +2159,39 @@"// 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 \"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 \"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);",- " },",- " );",- "}",- ""+ "}"],"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}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": ["payments",- ":id",- "capture"+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }],"variable": [{@@ -2228,83 +2201,87 @@}]},- "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": "Scenario15 Incremental auth with partial capture",+ "name": "Scenario3-Create payment without PMD","item": [{- "name": "Payments-Create",+ "name": "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 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.');",- "};"- ],- "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"- }- ]- },+ " 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"+ }+ }+ ],+ "request": {"method": "POST","header": [{@@ -2314,12 +2291,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "Authorization",- "value": "",- "type": "text",- "disabled": true}],"body": {@@ -2329,7 +2300,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\":\"8056594427\",\"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\":\"8056594427\",\"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://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",@@ -2345,27 +2316,81 @@"response": []},{- "name": "Incremental Authorization",+ "name": "Payments - Confirm","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);",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","",- "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();",+ "// 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\",",+ " );",+ " },",+ ");","",- " // Check if the 'status' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].status).to.eql(\"success\");",+ "// 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) {",+ " 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"@@ -2373,8 +2398,37 @@}],"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": [],+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],"body": {"mode": "raw","options": {@@ -2382,19 +2436,27 @@"language": "json"}},- "raw": "{\"amount\":1001}"+ "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/{{payment_id}}/incremental_authorization",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": ["payments",- "{{payment_id}}",- "incremental_authorization"+ ":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": []},@@ -2405,47 +2467,65 @@"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\");",+ " },",+ " );",+ "}",+ ""],"type": "text/javascript"}@@ -2457,16 +2537,10 @@{"key": "Accept","value": "application/json"- },- {- "key": "x-feature",- "value": "router-custom",- "type": "text",- "disabled": true}],"url": {- "raw": "{{baseUrl}}/payments/:id?expand_attempts=true&force_sync=true",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],@@ -2475,10 +2549,6 @@":id"],"query": [- {- "key": "expand_attempts",- "value": "true"- },{"key": "force_sync","value": "true"@@ -2487,38 +2557,41 @@"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"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario4-Create payment with Manual capture",+ "item": [{- "name": "Payments - Capture",+ "name": "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();","});","",@@ -2554,32 +2627,12 @@" );","}","",- "// Response body should have value \"partially_captured\" for \"status\"",+ "// Response body should have value \"requires_capture\" 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'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(500);",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");"," },"," );","}",@@ -2608,47 +2661,46 @@"language": "json"}},- "raw": "{\"amount_to_capture\":500,\"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/: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": []},{- "name": "Refunds - Create",+ "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",@@ -2657,35 +2709,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 \"succeeded\" for \"status\"","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 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}","",- "// Response body should have value \"500\" 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 '500'\",",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\","," function () {",- " pm.expect(jsonData.amount).to.eql(500);",+ " 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);"," },"," );","}",@@ -2714,75 +2789,92 @@"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": "{\"amount_to_capture\":6540,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {- "raw": "{{baseUrl}}/refunds",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": [- "refunds"+ "payments",+ ":id",+ "capture"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "description": "To create a refund against an already processed payment"+ "description": "To capture the funds for an uncaptured payment"},"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 \"500\" for \"amount\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '500'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.amount).to.eql(500);",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -2801,30 +2893,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": "Scenario17- Revoke mandates",+ "name": "Scenario4a-Create payment with partial capture","item": [{"name": "Payments - Create",@@ -2869,19 +2967,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);",@@ -2895,42 +2980,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_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;",- " },",- ");",- "",""],"type": "text/javascript"@@ -2956,7 +3014,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\":\"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",@@ -2972,26 +3030,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.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(\"[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();","});","",@@ -3027,31 +3088,35 @@" );","}","",- "// 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/capture - Content check if value for 'status' matches 'partially_captured'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"partially_captured\");"," },"," );","}","",- "// 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 '6000'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(6000);",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -3059,27 +3124,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\":6000,\"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": [{@@ -3089,12 +3162,12 @@}]},- "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": "List - Mandates",+ "name": "Payments - Retrieve","event": [{"listen": "test",@@ -3112,33 +3185,52 @@" );","});","",+ "// 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 \"active\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'active'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'partially_captured'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"active\");",+ " pm.expect(jsonData.status).to.eql(\"partially_captured\");"," },"," );","}",- "",- "// 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"@@ -3154,70 +3246,102 @@}],"url": {- "raw": "{{baseUrl}}/mandates/:id",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "mandates",+ "payments",":id"],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],"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": "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": "Revoke - Mandates",+ "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(\"[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.\",",+ " );",+ "}","",- "// 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/:id - Content check if value for 'status' matches 'revoked'\",",+ " \"[POST]::/payments - 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;",- " },",- ");",- "",""],"type": "text/javascript"@@ -3227,49 +3351,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\":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}}/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": "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(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable",@@ -3278,27 +3415,41 @@" jsonData = pm.response.json();","} catch (e) {}","",- "",- "// Response body should have value \"revoked\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - 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.\",",+ " );",+ "}","",+ "// Response body should have value \"cancelled\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"cancelled\");",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -3306,60 +3457,69 @@}],"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}}/mandates/:id",+ "raw": "{{baseUrl}}/payments/:id/cancel","host": ["{{baseUrl}}"],"path": [- "mandates",- ":id"+ "payments",+ ":id",+ "cancel"],"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": "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": "Scenario18- Update mandate card details",- "item": [+ },{- "name": "Mandate -Update",+ "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();","});","",@@ -3382,19 +3542,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);",@@ -3408,24 +3555,15 @@" );","}","",- "// 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\");"," },"," );","}",- "",- "// 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"@@ -3433,39 +3571,45 @@}],"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\":0,\"currency\":\"USD\",\"confirm\":true,\"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_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"12\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"payment_type\":\"setup_mandate\",\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"update_mandate_id\":\"{{mandate_id}}\",\"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",+ "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": "Scenario6-Refund full payment",+ "item": [{"name": "Payments - Create","event": [@@ -3509,19 +3653,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);",@@ -3544,44 +3675,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;",- " },",- ");",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(",- " \"- use {{customer_id}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.\",",- " );",- "}",""],"type": "text/javascript"@@ -3607,7 +3700,7 @@"language": "json"}},- "raw": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"customer_{{$randomAbbreviation}}\",\"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\":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",@@ -3665,6 +3758,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -3678,19 +3772,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.\",",- " );",- "}",- "","// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",@@ -3700,22 +3781,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"@@ -3758,19 +3823,19 @@"response": []},{- "name": "List - Mandates",+ "name": "Refunds - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - 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(\"[GET]::/payments/:id - 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\","," );",@@ -3782,34 +3847,38 @@" 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 \"active\" for \"status\"",+ "// Response body should have value \"pending\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'active'\",",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"active\");",+ " pm.expect(jsonData.status).to.eql(\"pending\");"," },"," );","}","",- "pm.test(\"[POST]::/payments - Verify last 4 digits of the card\", function () {",- " var jsonData = pm.response.json();",- " pm.expect(jsonData.card.last4_digits).to.eql(\"4242\");",- "});",- "",- "pm.test(\"[POST]::/payments - Verify card expiration month\", function () {",- " var jsonData = pm.response.json();",- " pm.expect(jsonData.card.card_exp_month).to.eql(\"10\");",- "});",- "",- "pm.test(\"[POST]::/payments - Verify card expiration year\", function () {",- " var jsonData = pm.response.json();",- " pm.expect(jsonData.card.card_exp_year).to.eql(\"25\");",- "});",- "",- "",- "",+ "// 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"@@ -3817,48 +3886,53 @@}],"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": "{\"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}}/mandates/:id",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "mandates",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{mandate_id}}",- "description": "(Required) Unique mandate id"- }+ "refunds"]},- "description": "To list the details of a mandate"+ "description": "To create a refund against an already processed payment"},"response": []},{- "name": "List - Mandates-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\","," );",@@ -3870,34 +3944,38 @@" 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 \"active\" for \"status\"",+ "// Response body should have value \"pending\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'active'\",",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"active\");",+ " pm.expect(jsonData.status).to.eql(\"pending\");"," },"," );","}","",- "pm.test(\"[POST]::/payments - Verify last 4 digits of the card\", function () {",- " var jsonData = pm.response.json();",- " pm.expect(jsonData.card.last4_digits).to.eql(\"1111\");",- "});",- "",- "pm.test(\"[POST]::/payments - Verify card expiration month\", function () {",- " var jsonData = pm.response.json();",- " pm.expect(jsonData.card.card_exp_month).to.eql(\"12\");",- "});",- "",- "pm.test(\"[POST]::/payments - Verify card expiration year\", function () {",- " var jsonData = pm.response.json();",- " pm.expect(jsonData.card.card_exp_year).to.eql(\"30\");",- "});",- "",- "",- "",+ "// 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"@@ -3913,28 +3991,33 @@}],"url": {- "raw": "{{baseUrl}}/mandates/:id",+ "raw": "{{baseUrl}}/refunds/:id","host": ["{{baseUrl}}"],"path": [- "mandates",+ "refunds",":id"],"variable": [{"key": "id",- "value": "{{mandate_id}}",- "description": "(Required) Unique mandate id"+ "value": "{{refund_id}}",+ "description": "(Required) unique refund id"}]},- "description": "To list the details of a mandate"+ "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": "Scenario6a-Partial refund",+ "item": [{- "name": "Recurring Payments - Create",+ "name": "Payments - Create","event": [{"listen": "test",@@ -3976,19 +4059,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);",@@ -4011,30 +4081,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;",- " },",- ");",- "",- "// 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"@@ -4060,7 +4106,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\":\"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",@@ -4076,7 +4122,7 @@"response": []},{- "name": "Payments - Retrieve-copy",+ "name": "Payments - Retrieve","event": [{"listen": "test",@@ -4118,7 +4164,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -4141,22 +4186,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"@@ -4197,86 +4226,64 @@"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 payment",- "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.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);",+ "// 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 \"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"@@ -4293,11 +4300,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "x-feature",- "value": "router-custom",- "type": "text"}],"body": {@@ -4307,95 +4309,78 @@"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\",\"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": "{\"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.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 \"requires_customer_action\" 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 '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"@@ -4411,111 +4396,83 @@}],"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 3ds mandate",- "item": [+ },{- "name": "Payments - Create",+ "name": "Refunds - Create-copy","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);",+ "// 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 \"requires_customer_action\" for \"status\"",+ "// Response body should have value \"1000\" 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 '1000'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " pm.expect(jsonData.amount).to.eql(1000);"," },"," );","}",- "",- "// 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"@@ -4532,11 +4489,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "x-feature",- "value": "router-custom",- "type": "text"}],"body": {@@ -4546,95 +4498,78 @@"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\"}}},\"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\":1000,\"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-copy","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 \"requires_customer_action\" 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 'requires_customer_action'\",",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " pm.expect(jsonData.amount).to.eql(1000);"," },"," );","}",- "",- "// 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"@@ -4650,58 +4585,47 @@}],"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": "Scenario1-Create payment with confirm true",- "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.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();","});","",@@ -4737,24 +4661,20 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"Succeeded\" 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 'succeeded'\","," function () {"," 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;",- " },",- ");",+ "// 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"@@ -4762,126 +4682,7 @@}],"request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- },- {- "key": "x-feature",- "value": "router-custom",- "type": "text"- }- ],- "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\":\"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\"}}"- },- "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\");",- " },",- " );",- "}",- "",- "// 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",+ "method": "GET","header": [{"key": "Accept",@@ -4918,7 +4719,7 @@]},{- "name": "Scenario2-Create payment with confirm false",+ "name": "Scenario7-Create a mandate and recurring payment","item": [{"name": "Payments - Create",@@ -4963,6 +4764,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);",@@ -4985,15 +4799,22 @@" },"," );","}",- ""- ],- "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"@@ -5019,7 +4840,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_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",@@ -5157,7 +4978,7 @@"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\"}}"+ "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",@@ -5181,6 +5002,68 @@},"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": "Payments - Retrieve","event": [@@ -5224,6 +5107,18 @@" );","}","",+ "// 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);",@@ -5237,15 +5132,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 - 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 \"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"@@ -5286,14 +5197,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": "Scenario2a-Create payment with confirm false card holder name null",- "item": [+ },{- "name": "Payments - Create",+ "name": "Recurring Payments - Create","event": [{"listen": "test",@@ -5335,120 +5241,16 @@" );","}","",- "// 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"- }- }- ],- "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\"}},\"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 - 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);",+ "// 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 {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",+ " \"- 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.\",",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\","," );","}","",@@ -5468,21 +5270,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\");"," },"," );","}",- ""- ],- "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;",+ " },",+ ");",+ "",+ "// 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"@@ -5490,26 +5307,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": [{@@ -5528,32 +5325,23 @@"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\"}}"+ "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",@@ -5595,6 +5383,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -5608,15 +5397,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 - 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 \"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"@@ -5661,7 +5466,7 @@]},{- "name": "Scenario2b-Create payment with confirm false card holder name empty",+ "name": "Scenario7a-Manual capture for recurring payments","item": [{"name": "Payments - Create",@@ -5706,6 +5511,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);",@@ -5719,140 +5537,41 @@" );","}","",- "// 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\");"," },"," );","}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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://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",- "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/: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 \"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\");"," },"," );",- "}"- ],- "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"@@ -5860,26 +5579,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": [{@@ -5898,27 +5597,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\":\"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/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": []},@@ -5978,15 +5668,32 @@" );","}","",- "// 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\");"," },"," );",- "}"+ "}",+ "",+ "// 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"}@@ -6026,14 +5733,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": "Scenario3-Create payment without PMD",- "item": [+ },{- "name": "Payments - Create",+ "name": "Recurring Payments - Create","event": [{"listen": "test",@@ -6075,6 +5777,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);",@@ -6088,15 +5803,39 @@" );","}","",- "// 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;",+ " },",+ ");",+ "",+ "// 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"@@ -6122,7 +5861,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,\"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",@@ -6138,20 +5877,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\",",@@ -6160,7 +5899,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();","});","",@@ -6195,51 +5934,43 @@" \"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/capture - 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"- }- }+ "",+ "// 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": {- "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": [{@@ -6258,17 +5989,17 @@"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": "{\"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": [{@@ -6278,12 +6009,12 @@}]},- "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": "Payments - Retrieve",+ "name": "Payments - Retrieve-copy","event": [{"listen": "test",@@ -6325,6 +6056,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -6338,15 +6070,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 - 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 \"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"@@ -6391,7 +6139,7 @@]},{- "name": "Scenario4-Create payment with Manual capture",+ "name": "Scenario8-Refund recurring payment","item": [{"name": "Payments - Create",@@ -6436,6 +6184,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);",@@ -6449,15 +6210,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"@@ -6483,7 +6270,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\",\"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",@@ -6499,29 +6286,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();","});","",@@ -6557,35 +6341,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"@@ -6593,35 +6373,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": [{@@ -6631,31 +6403,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.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();","});","",@@ -6678,6 +6450,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);",@@ -6700,73 +6485,101 @@" },"," );","}",- ""- ],- "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"+ "",+ "// 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;",+ " },",+ ");",+ "",+ "// 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"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "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\"}"+ },+ "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": "Scenario4a-Create payment with partial capture",- "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.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();","});","",@@ -6802,15 +6615,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"@@ -6818,64 +6647,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\":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}}/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 - Capture",+ "name": "Refunds - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - 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/: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(\"[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",@@ -6884,61 +6706,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 'partially_captured'\",",+ " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",+ " pm.expect(jsonData.status).to.eql(\"pending\");"," },"," );","}","","// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",+ "if (jsonData?.status) {"," pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",+ " \"[POST]::/refunds - 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"@@ -6964,92 +6763,75 @@"language": "json"}},- "raw": "{\"amount_to_capture\":6000,\"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/:id/capture",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "refunds"]},- "description": "To capture the funds for an uncaptured payment"+ "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.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 - Content check if value for 'status' matches 'partially_captured'\",",+ " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",+ " pm.expect(jsonData.amount).to.eql(6540);"," },"," );","}",@@ -7068,36 +6850,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": "Scenario5-Void the payment",+ "name": "Scenario9-Add card flow","item": [{"name": "Payments - Create",@@ -7106,65 +6882,54 @@"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 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\"",+ "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 - 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 'requires_payment_method'\", function() {",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " })};"],"type": "text/javascript"}@@ -7189,7 +6954,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\":\"stripesavecard_{{random_number}}\",\"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\":\"8056594427\",\"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\":\"8056594427\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -7205,20 +6970,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\",",@@ -7227,7 +6992,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();","});","",@@ -7250,6 +7015,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -7263,12 +7029,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\");"," },"," );","}",@@ -7276,9 +7042,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": [{@@ -7297,17 +7092,17 @@"language": "json"}},- "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"+ "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\",\"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": [{@@ -7317,76 +7112,37 @@}]},- "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": "Payments - Retrieve",+ "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\",",- " );",- "});",- "",- "// 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/: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 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.\",",- " );",- "}",+ "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,",- " );",+ "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 {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"cancelled\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"cancelled\");",- " },",- " );",- "}",- ""+ " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",+ "}"],"type": "text/javascript"}@@ -7401,58 +7157,138 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }+ "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 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 Customer ID"},"response": []- }- ]- },- {- "name": "Scenario6-Refund full payment",- "item": [+ },{- "name": "Payments - Create",+ "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();",+ "});",+ "",+ "// 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\":\"8056594427\",\"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\":\"8056594427\",\"country_code\":\"+91\"}},\"routing\":{\"type\":\"single\",\"data\":\"stripe\"},\"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();","});","",@@ -7491,12 +7327,23 @@"// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - 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\");"," },"," );","}",+ "",+ "",+ "// 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"@@ -7504,6 +7351,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": [{@@ -7522,18 +7389,27 @@"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": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\",\"card_cvc\":\"737\"}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "confirm"+ ],+ "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": "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": []},@@ -7556,17 +7432,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);",@@ -7593,16 +7469,6 @@" \"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"@@ -7618,7 +7484,7 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments/:id","host": ["{{baseUrl}}"],@@ -7626,12 +7492,6 @@"payments",":id"],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],"variable": [{"key": "id",@@ -7681,26 +7541,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 \"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"@@ -7726,7 +7566,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\":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",@@ -7778,26 +7618,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 \"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"@@ -7836,7 +7656,7 @@]},{- "name": "Scenario6a-Partial refund",+ "name": "Scenario10-Don't Pass CVV for save card flow and verifysuccess payment","item": [{"name": "Payments - Create",@@ -7845,65 +7665,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,",- " );",+ " 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 \"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.');",+ "};"],"type": "text/javascript"}@@ -7928,7 +7730,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\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"stripesavecard_{{random_number}}\",\"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\",\"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\":\"8056594427\",\"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\":\"8056594427\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -7944,71 +7746,32 @@"response": []},{- "name": "Payments - Retrieve",+ "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\",",- " );",- "});",- "",- "// 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/: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 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.\",",- " );",- "}",+ "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,",- " );",+ "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 {{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\");",- " },",- " );",- "}",- ""+ " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",+ "}"],"type": "text/javascript"}@@ -8023,90 +7786,76 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }+ "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 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 Customer ID"},"response": []},{- "name": "Refunds - Create",+ "name": "Save card payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - 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]::/refunds - 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){}","",- "// 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,",- " );",+ "// 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 {{refund_id}}, as jsonData.refund_id is undefined.\",",- " );",- "}",+ " 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\");",- " },",- " );",- "}","",- "// Response body should have value \"540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- ""+ "// 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"}@@ -8131,38 +7880,46 @@"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\":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\":\"8056594427\",\"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\":\"8056594427\",\"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}}/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": "Save card payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/refunds/: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]::/refunds/: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",@@ -8171,131 +7928,178 @@" 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\"",- "if (jsonData?.status) {",+ "// Response body should have value \"cybersource\" for \"connector\"",+ "if (jsonData?.connector) {"," pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'cybersource'\","," function () {",- " pm.expect(jsonData.amount).to.eql(540);",+ " 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": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",+ "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": [- "refunds",- ":id"+ "payments",+ ":id",+ "confirm"],"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": "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": "Refunds - Create-copy",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - 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]::/refunds - 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){}","",- "// 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,",- " );",+ "// 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 {{refund_id}}, as jsonData.refund_id is undefined.\",",- " );",- "}",+ " 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);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};","",- "// Response body should have value \"1000\" for \"amount\"",+ "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]::/refunds - Content check if value for 'amount' matches '1000'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.amount).to.eql(1000);",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );",- "}",- ""+ "}"],"type": "text/javascript"}@@ -8320,75 +8124,118 @@"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\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"adyensavecard_{{random_number}}\",\"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\",\"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\":\"8056594427\",\"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\":\"8056594427\",\"country_code\":\"+91\"}},\"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-copy",+ "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\"",+ "// 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]::/refunds - Content check if value for 'status' matches 'pending'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",+ " 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?.status) {",+ "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 '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);"," },"," );","}",@@ -8407,97 +8254,59 @@}],"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": "Payments - Retrieve-copy",+ "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\",",- " );",- "});",- "",- "// 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/: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) {}",+ "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,",- " );",+ "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 {{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 \"refunds\"",- "pm.test(\"[POST]::/payments - Content check if 'refunds' exists\", function () {",- " pm.expect(typeof jsonData.refunds !== \"undefined\").to.be.true;",- "});",- ""+ " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",+ "}"],"type": "text/javascript"}@@ -8512,132 +8321,75 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }+ "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 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 Customer ID"},"response": []- }- ]- },- {- "name": "Scenario7-Create a mandate and recurring payment",- "item": [+ },{- "name": "Payments - Create",+ "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,",- " );",- "} 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_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;",- " },",- ");",+ " 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"}@@ -8662,7 +8414,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\":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\":\"8056594427\",\"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\":\"8056594427\",\"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",@@ -8678,7 +8430,7 @@"response": []},{- "name": "Payments - Confirm",+ "name": "Save card payments - Confirm","event": [{"listen": "test",@@ -8723,7 +8475,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -8737,24 +8488,26 @@" );","}","",- "// 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/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id/confirm - 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 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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [""],"type": "text/javascript"@@ -8800,7 +8553,7 @@"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": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\",\"card_cvc\":\"7373\"}"},"url": {"raw": "{{baseUrl}}/payments/:id/confirm",@@ -8825,69 +8578,160 @@"response": []},{- "name": "List payment methods for a Customer",+ "name": "Payments - Capture","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 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(\"[GET]::/payment_methods/:customer_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(\"[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) {}","",- "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);",+ "// 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_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"+ " 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 filter and list the applicable payment methods for a particular Customer ID"+ "description": "To capture the funds for an uncaptured payment"},"response": []},{- "name": "Payments - Retrieve",+ "name": "Payments - Retrieve-copy","event": [{"listen": "test",@@ -8929,18 +8773,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);",@@ -8964,21 +8796,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 '6540'\",",+ " 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"@@ -9021,107 +8872,67 @@"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 \"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;",- " },",- ");",+ "// Validate the connector",+ "pm.test(\"[POST]::/payments - connector\", function () {",+ " pm.expect(jsonData.connector).to.eql(\"cybersource\");",+ "});",""],"type": "text/javascript"@@ -9147,103 +8958,78 @@"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": "{\"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"@@ -9259,141 +9045,89 @@}],"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": "Scenario7a-Manual capture for recurring payments",+ "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",+ "// 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\");",- " },",- " );",- "}","",- "// 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'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",+ "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;",- " },",- ");",+ "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"@@ -9401,6 +9135,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": [{@@ -9419,7 +9173,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\":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\":\"8056594427\",\"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\":\"8056594427\",\"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",@@ -9435,86 +9189,71 @@"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 - 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(\"[GET]::/payments/:id - 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);",+ "} 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\"",+ "// 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\");",- " },",- " );",- "}",+ "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"@@ -9522,37 +9261,76 @@}],"request": {- "method": "GET",+ "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"+ },+ {+ "key": "x-feature",+ "value": "router-custom",+ "type": "text",+ "disabled": true+ },+ {+ "key": "publishable_key",+ "value": "pk_snd_8798c6a9114646f8b970b93ad5765ddf",+ "type": "text",+ "disabled": true}],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "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\"}}}}}"+ },"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": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{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": []},@@ -9563,101 +9341,71 @@"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,",- " );",+ " 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_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 - 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;",+ "});","","// 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 'payment_method_data' exists\", function() {",+ " pm.expect((typeof jsonData.payment_method_data !== \"undefined\")).to.be.true;",+ "});",""],"type": "text/javascript"@@ -9665,6 +9413,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": [{@@ -9683,7 +9451,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\",\"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\":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\":\"8056594427\",\"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\":\"8056594427\",\"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",@@ -9697,96 +9465,54 @@"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-Incremental auth",+ "item": [{- "name": "Payments - Capture",+ "name": "Payments - Create","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 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/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.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 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 \"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\");",- " },",- " );",- "}",- "",- "// 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);",- " },",- " );",- "}",- ""+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};"],"type": "text/javascript"}@@ -9802,6 +9528,24 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "x-feature",+ "value": "router-custom",+ "type": "text",+ "disabled": true+ },+ {+ "key": "Authorization",+ "value": "",+ "type": "text",+ "disabled": true+ },+ {+ "key": "x-feature",+ "value": "integ-custom",+ "type": "text",+ "disabled": true}],"body": {@@ -9811,113 +9555,123 @@"language": "json"}},- "raw": "{\"amount_to_capture\":6540,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "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\":\"8056594427\",\"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\":\"8056594427\",\"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\"}}"},"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": []},{- "name": "Payments - Retrieve-copy",+ "name": "Incremental Authorization","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",+ "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": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// 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.\",",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret 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;",- " },",- ");","",- "// 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 \"requires_capture\" 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\");",+ "})};"],"type": "text/javascript"}@@ -9929,10 +9683,16 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "x-feature",+ "value": "router-custom",+ "type": "text",+ "disabled": true}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments/:id?expand_attempts=true&force_sync=true","host": ["{{baseUrl}}"],@@ -9941,6 +9701,10 @@":id"],"query": [+ {+ "key": "expand_attempts",+ "value": "true"+ },{"key": "force_sync","value": "true"@@ -9949,43 +9713,40 @@"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{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": "Scenario8-Refund recurring 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\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",+ "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 = {};",@@ -10006,19 +9767,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);",@@ -10035,38 +9783,32 @@"// Response body should have value \"succeeded\" 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 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}","",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",+ "// Response body should have value \"1001\" for \"amount\"",+ "if (jsonData?.amount) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '1001'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.amount).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 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);",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -10092,102 +9834,87 @@"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_to_capture\":1001,\"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": "Refunds - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - 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(\"[GET]::/payments/:id - 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(\"[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 \"1001\" 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 '6540'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.amount).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;",- " },",- ");",""],"type": "text/javascript"@@ -10195,213 +9922,810 @@}],"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": "{\"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\"}}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "refunds"]},- "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 create a refund against an already processed payment"},"response": []},{- "name": "Recurring Payments - Create",+ "name": "Refunds - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - 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 - 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(\"[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 \"1001\" 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 '1001'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.amount).to.eql(1001);"," },"," );","}",+ ""+ ],+ "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": "Scenario14-Incremental auth for mandates",+ "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.');",+ "};"+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ },+ {+ "key": "x-feature",+ "value": "router-custom",+ "type": "text",+ "disabled": true+ },+ {+ "key": "Authorization",+ "value": "",+ "type": "text",+ "disabled": true+ },+ {+ "key": "x-feature",+ "value": "integ-custom",+ "type": "text",+ "disabled": true+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "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\":\"8056594427\",\"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\":\"8056594427\",\"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\"}}"+ },+ "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": "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": [+ {+ "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 \"requires_capture\" 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\");",+ "})};"+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ },+ {+ "key": "x-feature",+ "value": "router-custom",+ "type": "text",+ "disabled": true+ }+ ],+ "url": {+ "raw": "{{baseUrl}}/payments/:id?expand_attempts=true&force_sync=true",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "expand_attempts",+ "value": "true"+ },+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{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": "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\");",+ " },",+ " );",+ "}",+ "",+ "// 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 \"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);",+ " },",+ " );",+ "}",+ ""+ ],+ "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\":1001,\"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": "Scenario15-Incremental auth with partial 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.');",+ "};"+ ],+ "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"+ },+ {+ "key": "Authorization",+ "value": "",+ "type": "text",+ "disabled": true+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "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\":\"8056594427\",\"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\":\"8056594427\",\"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\"}}"+ },+ "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": "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": [+ {+ "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 \"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;",- " },",- ");",- ""+ "",+ "// Response body should have value \"requires_capture\" 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\");",+ "})};"],"type": "text/javascript"}}],"request": {- "method": "POST",+ "method": "GET","header": [{- "key": "Content-Type",+ "key": "Accept","value": "application/json"},{- "key": "Accept",- "value": "application/json"+ "key": "x-feature",+ "value": "router-custom",+ "type": "text",+ "disabled": true}],- "body": {- "mode": "raw",- "options": {- "raw": {- "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\"}"- },"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id?expand_attempts=true&force_sync=true","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "expand_attempts",+ "value": "true"+ },+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "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": "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-copy",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - 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(\"[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();","});","",@@ -10437,31 +10761,35 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"partially_captured\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"partially_captured\");"," },"," );","}","",- "// 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 \"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 \"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 \"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"@@ -10469,27 +10797,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\":500,\"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": [{@@ -10499,7 +10835,7 @@}]},- "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": []},@@ -10551,12 +10887,12 @@" );","}","",- "// Response body should have value \"6540\" for \"amount\"",+ "// Response body should have value \"500\" 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 '500'\","," function () {",- " pm.expect(jsonData.amount).to.eql(6540);",+ " pm.expect(jsonData.amount).to.eql(500);"," },"," );","}",@@ -10585,7 +10921,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\":500,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {"raw": "{{baseUrl}}/refunds",@@ -10648,173 +10984,76 @@" );","}","",- "// Response body should have value \"6540\" for \"amount\"",+ "// Response body should have value \"500\" 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"- }- }- ],- "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": "Scenario9-Add card flow",- "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 \"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\");",- " })};"+ " \"[POST]::/refunds - Content check if value for 'amount' matches '500'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(500);",+ " },",+ " );",+ "}",+ ""],"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\":\"stripesavecard_{{random_number}}\",\"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\":\"8056594427\",\"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\":\"8056594427\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"- },"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/refunds/:id","host": ["{{baseUrl}}"],"path": [- "payments"+ "refunds",+ ":id"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{refund_id}}",+ "description": "(Required) unique refund 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 Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario16-Verify PML for mandate",+ "item": [{- "name": "Payments - Confirm",+ "name": "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();","});","",@@ -10837,6 +11076,18 @@" );","}","",+ "// 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) {",@@ -10851,24 +11102,31 @@" );","}","",- "// 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/confirm - 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\");"," },"," );","}",- ""- ],- "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"@@ -10876,26 +11134,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": [{@@ -10914,63 +11152,89 @@"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\",\"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\":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/: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": "List payment methods for a Customer",+ "name": "List payment methods for a Merchant","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 status 2xx",+ "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]::/payment_methods/:customer_id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",- "});",+ "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){}",+ "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.');",- "}"+ "",+ "// 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\");",+ " },",+ " );",+ "}",+ ""],"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": [{@@ -10979,75 +11243,106 @@}],"url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",+ "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}","host": ["{{baseUrl}}"],"path": [- "customers",- ":customer_id",+ "account","payment_methods"],- "variable": [+ "query": [{- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"+ "key": "client_secret",+ "value": "{{client_secret}}"}]},- "description": "To filter and list the applicable payment methods for a particular Customer ID"+ "description": "To filter and list the applicable payment methods for a particular merchant id."},"response": []},{- "name": "Save card payments - Create",+ "name": "Payments - Create-copy","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.\",",+ " );",+ "}","","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"}@@ -11072,7 +11367,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://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\":\"8056594427\",\"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\":\"8056594427\",\"country_code\":\"+91\"}},\"routing\":{\"type\":\"single\",\"data\":\"stripe\"},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "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",@@ -11088,20 +11383,23 @@"response": []},{- "name": "Save card 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\",",@@ -11109,60 +11407,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) {",- " 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) {",+ "// 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 'connector' matches 'cybersource'\",",+ " \"[POST]::/payments - Content check if value for 'payment_type' matches 'setup_mandate'\","," function () {",- " pm.expect(jsonData.connector).to.eql(\"cybersource\");",+ " pm.expect(jsonData.payment_type).to.eql(\"setup_mandate\");"," },"," );","}",@@ -11193,78 +11450,68 @@}]},- "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_token\":\"{{payment_token}}\",\"card_cvc\":\"737\"}"- },"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": "Scenario17-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(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "","// Set response object as internal variable","let jsonData = {};","try {"," jsonData = pm.response.json();","} catch (e) {}","",- "// Validate 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);",@@ -11278,6 +11525,18 @@" );","}","",+ "// 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) {",@@ -11291,78 +11550,43 @@" \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\","," );","}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "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\",",+ "// 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\");",+ " },"," );",- "});",- "",- "// 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 \"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"@@ -11388,58 +11612,102 @@"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\"}}"+ "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.\",",+ " );",+ "}",+ "",+ "// 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"@@ -11455,145 +11723,79 @@}],"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": "Scenario10-Don't Pass CVV for save card flow and verifysuccess payment",- "item": [+ },{- "name": "Payments - Create",+ "name": "List - Mandates","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\");",- "});",- "",- "// Validate if response has JSON Body ",- "pm.test(\"[POST]::/payments - 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","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 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 \"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\");",+ " },",+ " );",+ "}","",- "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_{{random_number}}\",\"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\",\"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\":\"8056594427\",\"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\":\"8056594427\",\"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;",- "});",+ "// 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 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"}@@ -11608,76 +11810,71 @@}],"url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",+ "raw": "{{baseUrl}}/mandates/:id","host": ["{{baseUrl}}"],"path": [- "customers",- ":customer_id",- "payment_methods"+ "mandates",+ ":id"],"variable": [{- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"+ "key": "id",+ "value": "{{mandate_id}}",+ "description": "(Required) Unique mandate id"}]},- "description": "To filter and list the applicable payment methods for a particular Customer ID"+ "description": "To list the details of a mandate"},"response": []},{- "name": "Save card payments - Create",+ "name": "Revoke - Mandates","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 status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});",- "",- "// Validate if response has JSON Body ",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "",+ "// 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){}",+ "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 \"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\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_id !== \"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"}@@ -11686,62 +11883,49 @@"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\":\"8056594427\",\"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\":\"8056594427\",\"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}}/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": "Save card payments - Confirm",+ "name": "List - Mandates-copy","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",@@ -11750,119 +11934,66 @@" 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) {",+ "// Response body should have value \"revoked\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'cybersource'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'revoked'\","," function () {",- " pm.expect(jsonData.connector).to.eql(\"cybersource\");",+ " pm.expect(jsonData.status).to.eql(\"revoked\");"," },"," );","}","",- "// 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\");",- " })};"+ "// 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": {- "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",+ "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_token\":\"{{payment_token}}\"}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/mandates/:id","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"+ "mandates",+ ":id"],"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{mandate_id}}",+ "description": "(Required) Unique 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 list the details of a mandate"},"response": []}]},{- "name": "Scenario11-Save card payment with manual capture",+ "name": "Scenario18-Update mandate card details","item": [{"name": "Payments - Create",@@ -11871,47 +12002,77 @@"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);",- "} 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\");",+ " },",+ " );",+ "}","","// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",@@ -11921,7 +12082,36 @@" 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;",+ " },",+ ");",+ "",+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(",+ " \"- use {{customer_id}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.\",",+ " );",+ "}",+ ""],"type": "text/javascript"}@@ -11946,7 +12136,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\":\"adyensavecard_{{random_number}}\",\"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\",\"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\":\"8056594427\",\"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\":\"8056594427\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"count_tickets\":1,\"transaction_number\":\"5590045\"}}"+ "raw": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"customer_{{$randomAbbreviation}}\",\"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",@@ -12017,6 +12207,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.\",",+ " );",+ "}",+ "","// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",@@ -12027,255 +12230,79 @@" );","}","",- "// 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 \"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 \"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);",- " },",- " );",- "}",+ "// 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"- ],- "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"- },+ "request": {+ "method": "GET",+ "header": [{"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\":\"8056594427\",\"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\":\"8056594427\",\"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": "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",@@ -12284,52 +12311,34 @@" 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 \"active\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'requires_capture'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'active'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " pm.expect(jsonData.status).to.eql(\"active\");"," },"," );","}","",+ "pm.test(\"[POST]::/payments - Verify last 4 digits of the card\", function () {",+ " var jsonData = pm.response.json();",+ " pm.expect(jsonData.card.last4_digits).to.eql(\"4242\");",+ "});",+ "",+ "pm.test(\"[POST]::/payments - Verify card expiration month\", function () {",+ " var jsonData = pm.response.json();",+ " pm.expect(jsonData.card.card_exp_month).to.eql(\"10\");",+ "});",+ "",+ "pm.test(\"[POST]::/payments - Verify card expiration year\", function () {",+ " var jsonData = pm.response.json();",+ " pm.expect(jsonData.card.card_exp_year).to.eql(\"25\");",+ "});",+ "",+ "","",- "// 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"@@ -12337,92 +12346,55 @@}],"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",+ "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_token\":\"{{payment_token}}\",\"card_cvc\":\"7373\"}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/mandates/:id","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"+ "mandates",+ ":id"],"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{mandate_id}}",+ "description": "(Required) Unique 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 list the details of a mandate"},"response": []},{- "name": "Payments - Capture",+ "name": "Mandate - Update","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();","});","",@@ -12445,6 +12417,18 @@" );","}","",+ "// 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) {",@@ -12462,47 +12446,21 @@"// 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\");"," },"," );","}","",- "// 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 \"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_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"@@ -12528,32 +12486,23 @@"language": "json"}},- "raw": "{\"amount_to_capture\":6540,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":true,\"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_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"12\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"payment_type\":\"setup_mandate\",\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"update_mandate_id\":\"{{mandate_id}}\",\"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/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": []},{- "name": "Payments - Retrieve-copy",+ "name": "List - Mandates-copy","event": [{"listen": "test",@@ -12565,15 +12514,10 @@"});","","// 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]::/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",@@ -12582,76 +12526,34 @@" 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 - 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\");"," },"," );","}","",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"cybersource\");",+ "pm.test(\"[POST]::/payments - Verify last 4 digits of the card\", function () {",+ " var jsonData = pm.response.json();",+ " pm.expect(jsonData.card.last4_digits).to.eql(\"1111\");",+ "});",+ "",+ "pm.test(\"[POST]::/payments - Verify card expiration month\", function () {",+ " var jsonData = pm.response.json();",+ " pm.expect(jsonData.card.card_exp_month).to.eql(\"12\");",+ "});",+ "",+ "pm.test(\"[POST]::/payments - Verify card expiration year\", function () {",+ " var jsonData = pm.response.json();",+ " pm.expect(jsonData.card.card_exp_year).to.eql(\"30\");","});","",- "// 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 \"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"@@ -12667,94 +12569,128 @@}],"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": "Refunds - Create",+ "name": "Recurring 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.\",",+ " \"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 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.\","," );","}","",- "// Response body should have value \"540\" for \"amount\"",+ "// 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]::/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;",+ " },",+ ");",+ "",+ "// 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"@@ -12780,78 +12716,103 @@"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\",\"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}}/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-copy","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"@@ -12867,30 +12828,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": "Scenario16-Verify PML for mandate",+ "name": "Scenario19-Create 3ds payment","item": [{"name": "Payments - Create",@@ -12935,19 +12902,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);",@@ -12961,29 +12915,22 @@" );","}","",- "// Response body should have value \"requires_confirmation\" 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_confirmation'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");"," },"," );","}","",- "// 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\"",+ "// Response body should have \"connector_transaction_id\"","pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\","," function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;"," },",");",""@@ -13002,6 +12949,11 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "x-feature",+ "value": "router-custom",+ "type": "text"}],"body": {@@ -13011,7 +12963,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,\"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\",\"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\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -13027,29 +12979,28 @@"response": []},{- "name": "List payment methods for a Merchant",+ "name": "Payments - Retrieve","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(\"[GET]::/payments/: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\",",- " );",- " },",- ");",+ "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 = {};",@@ -13057,16 +13008,50 @@" 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 \"new_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 \"requires_customer_action\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'payment_type' matches 'new_mandate'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_customer_action'\","," function () {",- " pm.expect(jsonData.payment_type).to.eql(\"new_mandate\");",+ " 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"@@ -13074,26 +13059,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": "GET","header": [{@@ -13102,27 +13067,39 @@}],"url": {- "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "account",- "payment_methods"+ "payments",+ ":id"],"query": [{- "key": "client_secret",- "value": "{{client_secret}}"+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "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": "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": "Scenario20-Create 3ds mandate",+ "item": [{- "name": "Payments - Create-copy",+ "name": "Payments - Create","event": [{"listen": "test",@@ -13164,19 +13141,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);",@@ -13190,17 +13154,24 @@" );","}","",- "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_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"@@ -13217,6 +13188,11 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "x-feature",+ "value": "router-custom",+ "type": "text"}],"body": {@@ -13226,7 +13202,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\":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\"}}},\"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",@@ -13242,29 +13218,28 @@"response": []},{- "name": "List payment methods for a Merchant-copy",+ "name": "Payments - Retrieve","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(\"[GET]::/payments/: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\",",- " );",- " },",- ");",+ "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 = {};",@@ -13272,16 +13247,50 @@" 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 \"setup_mandate\" for \"payment_type\"",- "if (jsonData?.payment_type) {",+ "// Response body should have value \"requires_customer_action\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'payment_type' matches 'setup_mandate'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_customer_action'\","," function () {",- " pm.expect(jsonData.payment_type).to.eql(\"setup_mandate\");",+ " 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"@@ -13289,26 +13298,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": "GET","header": [{@@ -13317,22 +13306,29 @@}],"url": {- "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "account",- "payment_methods"+ "payments",+ ":id"],"query": [{- "key": "client_secret",- "value": "{{client_secret}}"+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "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": "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": []}@@ -14042,17 +14038,17 @@"name": "Variation Cases","item": [{- "name": "Scenario10- Manual multiple capture",+ "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 5xx",- "pm.test(\"[POST]::/payments - Status code is 5xx\", function () {",+ "// Validate status 4xx",+ "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {"," pm.response.to.be.error;","});","",@@ -14099,15 +14095,20 @@" \"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_error'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.error.type).to.eql(\"connector_error\");"," },"," );",- "","}",""],@@ -14134,7 +14135,7 @@"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": "{\"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",@@ -14148,22 +14149,17 @@"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- Revoke for revoked mandates",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Create(Invalid Exp month)","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",@@ -14197,19 +14193,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);",@@ -14223,42 +14206,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 \"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) {",+ "// 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 '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"@@ -14284,7 +14245,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\":\"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",@@ -14300,26 +14261,26 @@"response": []},{- "name": "Payments - Retrieve",+ "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(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -14350,121 +14311,35 @@" 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"- ],- "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": "Revoke - Mandates",- "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\",",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\","," );",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "}","",+ "// 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"@@ -14474,70 +14349,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"@@ -14547,36 +14459,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": "Scenario14- Recurring payment for revoked mandates",+ "name": "Scenario2-Confirming the payment without PMD","item": [{"name": "Payments - Create",@@ -14621,19 +14538,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);",@@ -14647,41 +14551,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"@@ -14707,7 +14585,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\":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",@@ -14723,22 +14601,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",@@ -14747,25 +14633,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"@@ -14773,44 +14692,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",@@ -14831,6 +14789,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);",@@ -14844,20 +14815,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"@@ -14883,7 +14849,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",@@ -14899,26 +14865,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();","});","",@@ -14941,7 +14910,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -14955,31 +14923,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"@@ -14987,27 +14947,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": [{@@ -15017,36 +14985,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": "Scenario15- Setup_future_usage is off_session for normal payments",- "item": [+ },{- "name": "Payments - Create",+ "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();","});","",@@ -15082,29 +15045,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 'setup_future_usage` cannot be `off_session` for normal payments\", function () {",- " pm.expect(jsonData.error.message).to.eql(\"`setup_future_usage` cannot be `off_session` for normal payments\");",- "});",- "",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [""],"type": "text/javascript"@@ -15112,43 +15061,44 @@}],"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\",\"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": "Scenario16- Setup_future_usage is on_session for mandates payments -confirm false",+ "name": "Scenario4-Capture the succeeded payment","item": [{"name": "Payments - Create",@@ -15193,19 +15143,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);",@@ -15219,12 +15156,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\");"," },"," );","}",@@ -15232,15 +15169,6 @@],"type": "text/javascript"}- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }}],"request": {@@ -15262,7 +15190,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",@@ -15278,20 +15206,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\",",@@ -15300,7 +15228,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();","});","",@@ -15323,7 +15251,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -15337,31 +15264,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"@@ -15369,26 +15288,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": [{@@ -15407,17 +15306,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": [{@@ -15427,14 +15326,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": "Scenario17- Setup_future_usage is null for normal payments",+ "name": "Scenario5-Void the success_slash_failure payment","item": [{"name": "Payments - Create",@@ -15479,19 +15378,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);",@@ -15505,12 +15391,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\");"," },"," );","}",@@ -15518,15 +15404,6 @@],"type": "text/javascript"}- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }}],"request": {@@ -15548,7 +15425,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",@@ -15564,20 +15441,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\",",@@ -15586,7 +15463,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();","});","",@@ -15609,7 +15486,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -15623,23 +15499,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"@@ -15647,26 +15523,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": [{@@ -15685,105 +15541,45 @@"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": [{"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": "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"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment 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": []}]},{- "name": "Scenario1-Create payment with Invalid card details",+ "name": "Scenario7-Refund exceeds amount","item": [{- "name": "Payments - Create(Invalid card number)",+ "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",@@ -15830,17 +15626,12 @@" );","}","",- "// 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 \"succeeded\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"connector_error\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",@@ -15869,7 +15660,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\":\"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": "{\"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",@@ -15885,26 +15676,26 @@"response": []},{- "name": "Payments - Create(Invalid Exp month)",+ "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();","});","",@@ -15940,17 +15731,12 @@" );","}","",- "// 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\");"," },"," );","}",@@ -15961,119 +15747,95 @@}],"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\":\"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",+ "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 Exp Year)",+ "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);",- " 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 \"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 \"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\");"," },"," );","}",- "",- "// 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"@@ -16099,31 +15861,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\":\"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\"}}"+ "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}}/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": "Scenario8-Refund for unsuccessful payment",+ "item": [{- "name": "Payments - Create(invalid CVV)",+ "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",@@ -16170,17 +15937,12 @@" );","}","",- "// 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 \"requires_confirmation\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"connector\");",+ " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");"," },"," );","}",@@ -16209,7 +15971,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\":\"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\"}}"+ "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",@@ -16223,33 +15985,28 @@"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": "Scenario2-Confirming the payment without PMD",- "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();","});","",@@ -16285,12 +16042,12 @@" );","}","",- "// Response body should have value \"requires_payment_method\" 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 'requires_payment_method'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");"," },"," );","}",@@ -16301,64 +16058,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\"}},\"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": "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/: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();",+ "// 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",@@ -16367,29 +16117,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);",+ "// 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.\","," );","}","",@@ -16401,7 +16138,7 @@" },",");","",- "// Response body should have value \"connector error\" for \"error type\"",+ "// 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'\",",@@ -16414,38 +16151,9 @@],"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": [{@@ -16464,34 +16172,25 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\"}"+ "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/:id/confirm",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "refunds"]},- "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 create a refund against an already processed payment"},"response": []}]},{- "name": "Scenario3-Capture greater amount",+ "name": "Scenario9-Create a recurring payment with greater mandate amount","item": [{"name": "Payments - Create",@@ -16536,6 +16235,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);",@@ -16549,15 +16261,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"@@ -16583,7 +16321,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\",\"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\"}}},\"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",@@ -16599,29 +16337,26 @@"response": []},{- "name": "Payments - Capture",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/capture - 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/: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();","});","",@@ -16657,23 +16392,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) {",+ "// 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/: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 \"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"@@ -16681,35 +16424,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\":7000,\"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": [{@@ -16719,31 +16454,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();","});","",@@ -16766,6 +16501,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);",@@ -16779,12 +16527,20 @@" );","}","",- "// Response body should have value \"requires_capture\" 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 - Content check if value for 'status' matches 'requires_capture'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );","}",@@ -16795,44 +16551,43 @@}],"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\":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/: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": "Scenario4-Capture the succeeded payment",+ "name": "Scenario10-Manual multiple capture","item": [{"name": "Payments - Create",@@ -16841,9 +16596,9 @@"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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",@@ -16889,15 +16644,15 @@" \"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 \"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 'invalid_request'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );",+ "","}",""],@@ -16924,7 +16679,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\":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}}/payments",@@ -16938,31 +16693,33 @@"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": "Scenario11-Failure card",+ "item": [{- "name": "Payments - Capture",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/capture - 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/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();","});","",@@ -16998,23 +16755,28 @@" );","}","",- "// 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) {",+ "// Response body should have value \"failed\" 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 'failed'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.status).to.eql(\"failed\");"," },"," );","}",+ "",+ "// Check if error code exists",+ "pm.test(\"[POST]::/payments - Content check if error code exists\", function () {",+ " pm.expect(jsonData.error_code).to.not.equal(null);;",+ "});",+ "",+ "// Check if error message exists",+ "pm.test(\"[POST]::/payments - Content check if error message exists\", function () {",+ " pm.expect(jsonData.error_message).to.not.equal(null);;",+ "});",+ "",+ "",+ "",""],"type": "text/javascript"@@ -17031,6 +16793,11 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "x-feature",+ "value": "router-custom",+ "type": "text"}],"body": {@@ -17040,56 +16807,42 @@"language": "json"}},- "raw": "{\"amount_to_capture\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "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\",\"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\":\"412345678912345678914\",\"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\"}}"},"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": []- }- ]- },- {- "name": "Scenario5-Void the success_slash_failure payment",- "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();","});","",@@ -17125,15 +16878,26 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"failed\" 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 'failed'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"failed\");"," },"," );","}",+ "",+ "// Check if error code exists",+ "pm.test(\"[POST]::/payments - Content check if error code exists\", function () {",+ " pm.expect(jsonData.error_code).to.not.equal(null);;",+ "});",+ "",+ "// Check if error message exists",+ "pm.test(\"[POST]::/payments - Content check if error message exists\", function () {",+ " pm.expect(jsonData.error_message).to.not.equal(null);;",+ "});",+ "",""],"type": "text/javascript"@@ -17141,63 +16905,66 @@}],"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\":\"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}}/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": "Scenario12-Refund exceeds amount captured",+ "item": [{- "name": "Payments - Cancel",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/cancel - 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/cancel - 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/cancel - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -17233,20 +17000,12 @@" );","}","",- "// 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) {",+ "// Response body should have value \"requires_capture\" 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 'requires_capture'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");"," },"," );","}",@@ -17275,56 +17034,45 @@"language": "json"}},- "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"+ "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/cancel",+ "raw": "{{baseUrl}}/payments","host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "cancel"+ "{{baseUrl}}"],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "path": [+ "payments"]},- "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": "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": "Scenario7-Refund exceeds amount",- "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();","});","",@@ -17363,9 +17111,29 @@"// Response body should have value \"succeeded\" 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 'partially_captured'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " 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'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(6000);"," },"," );","}",@@ -17394,18 +17162,27 @@"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_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": []},@@ -17468,9 +17245,9 @@"// 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 'partially_captured'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"partially_captured\");"," },"," );","}",@@ -17561,7 +17338,7 @@" },",");","",- "// Response body should have value \"connector error\" for \"error type\"",+ "// 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'\",",@@ -17570,6 +17347,16 @@" },"," );","}",+ "",+ "// Response body should have value \"The refund amount exceeds the amount captured\" for \"error message\"",+ "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'\",",+ " function () {",+ " pm.expect(jsonData.error.message).to.eql(\"The refund amount exceeds the amount captured\");",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -17595,7 +17382,7 @@"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\"}}"+ "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",@@ -17613,7 +17400,7 @@]},{- "name": "Scenario8-Refund for unsuccessful payment",+ "name": "Scenario13-Revoke for revoked mandates","item": [{"name": "Payments - Create",@@ -17658,6 +17445,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);",@@ -17671,15 +17471,42 @@" );","}","",- "// 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\");",+ " },",+ " );",+ "}",+ "",+ "// 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"@@ -17705,7 +17532,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\"}},\"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",@@ -17776,15 +17603,31 @@" );","}","",- "// 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\");"," },"," );","}",+ "",+ "// 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"@@ -17827,19 +17670,19 @@"response": []},{- "name": "Refunds - Create",+ "name": "Revoke - Mandates","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]::/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\","," );",@@ -17851,36 +17694,98 @@" 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 \"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 \"error\"",+ "// Response body should have \"mandate_id\"","pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",+ " \"[POST]::/payments - Content check if 'mandate_id' exists\","," function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;"," },",");","",- "// Response body should have value \"invalid_request\" for \"error type\"",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {+ "raw": "{{baseUrl}}/mandates/revoke/:id",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "mandates",+ "revoke",+ ":id"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{mandate_id}}"+ }+ ]+ },+ "description": "To revoke a mandate registered against a customer"+ },+ "response": []+ },+ {+ "name": "Revoke - Mandates-copy",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// 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(\"[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 \"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.reason' matches 'Mandate has already been revoked\", function () {",+ " pm.expect(jsonData.error.reason).to.eql(\"Mandate has already been revoked\");",+ "});",""],"type": "text/javascript"@@ -17890,41 +17795,36 @@"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\":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}}/mandates/revoke/:id","host": ["{{baseUrl}}"],"path": [- "refunds"+ "mandates",+ "revoke",+ ":id"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{mandate_id}}"+ }]},- "description": "To create a refund against an already processed payment"+ "description": "To revoke a mandate registered against a customer"},"response": []}]},{- "name": "Scenario9-Create a recurring payment with greater mandate amount",+ "name": "Scenario14-Recurring payment for revoked mandates","item": [{"name": "Payments - Create",@@ -18055,7 +17955,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\"}}},\"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",@@ -18071,7 +17971,7 @@"response": []},{- "name": "Payments - Retrieve",+ "name": "Revoke - Mandates","event": [{"listen": "test",@@ -18089,49 +17989,19 @@" );","});","",- "// 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/:id - Content check if value for 'status' matches 'revoked'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"revoked\");"," },"," );","}",@@ -18144,13 +18014,6 @@" },",");","",- "// 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"@@ -18158,7 +18021,7 @@}],"request": {- "method": "GET",+ "method": "POST","header": [{"key": "Accept",@@ -18166,29 +18029,23 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/mandates/revoke/:id","host": ["{{baseUrl}}"],"path": [- "payments",+ "mandates",+ "revoke",":id"],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{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 revoke a mandate registered against a customer"},"response": []},@@ -18222,32 +18079,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 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);",@@ -18261,23 +18092,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 \"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'\",",+ " \"[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"@@ -18303,25 +18131,148 @@"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\"}"+ "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",+ "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\");",+ " },",+ " );",+ "}",+ "",+ "// 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",+ "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": "Scenario11-Failure card",+ "name": "Scenario15-Setup_future_usage is off_session for normal payments","item": [{"name": "Payments - Create",@@ -18330,9 +18281,9 @@"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",@@ -18379,28 +18330,29 @@" );","}","",- "// Response body should have value \"failed\" 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 'failed'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },"," );","}","",- "// Check if error code exists",- "pm.test(\"[POST]::/payments - Content check if error code exists\", function () {",- " pm.expect(jsonData.error_code).to.not.equal(null);;",- "});",- "",- "// Check if error message exists",- "pm.test(\"[POST]::/payments - Content check if error message exists\", function () {",- " pm.expect(jsonData.error_message).to.not.equal(null);;",+ "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` cannot be `off_session` for normal payments\");","});","",- "",- "",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -18417,11 +18369,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "x-feature",- "value": "router-custom",- "type": "text"}],"body": {@@ -18431,7 +18378,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]\",\"setup_future_usage\":\"on_session\",\"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\":\"412345678912345678914\",\"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_{{$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\",\"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",@@ -18445,28 +18392,33 @@"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": "Scenario16-Setup_future_usage is on_session for mandates payments -confirm false",+ "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();","});","",@@ -18489,6 +18441,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);",@@ -18502,26 +18467,24 @@" );","}","",- "// Response body should have value \"failed\" 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 'failed'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",- "",- "// Check if error code exists",- "pm.test(\"[POST]::/payments - Content check if error code exists\", function () {",- " pm.expect(jsonData.error_code).to.not.equal(null);;",- "});",- "",- "// Check if error message exists",- "pm.test(\"[POST]::/payments - Content check if error message exists\", function () {",- " pm.expect(jsonData.error_message).to.not.equal(null);;",- "});",- "",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -18529,66 +18492,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\":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/: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": "Scenario12-Refund exceeds amount captured",- "item": [+ },{- "name": "Payments - Create",+ "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 status 4xx",+ "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 - 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 - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -18611,6 +18571,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -18624,15 +18585,31 @@" );","}","",- "// Response body should have value \"requires_capture\" 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_capture'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " 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"@@ -18640,6 +18617,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": [{@@ -18658,45 +18655,56 @@"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": "{\"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",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "confirm"+ ],+ "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": "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-Setup_future_usage is null for normal payments",+ "item": [{- "name": "Payments - Capture",+ "name": "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();","});","",@@ -18719,6 +18727,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);",@@ -18732,32 +18753,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/: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 - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(6000);",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",@@ -18765,6 +18766,15 @@],"type": "text/javascript"}+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }}],"request": {@@ -18786,51 +18796,45 @@"language": "json"}},- "raw": "{\"amount_to_capture\":6000,\"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\",\"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"- }+ "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": "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();","});","",@@ -18853,6 +18857,7 @@" );","}","",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -18869,12 +18874,20 @@"// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - 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\");"," },"," );",- "}",+ "}"+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -18882,27 +18895,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": [{@@ -18912,112 +18953,67 @@}]},- "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;",- " },",- ");",- "",- "// 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\");",- " },",- " );",- "}",+ "try {jsonData = pm.response.json();}catch(e){}","",- "// Response body should have value \"The refund amount exceeds the amount captured\" for \"error message\"",- "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'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(\"The refund amount exceeds the amount captured\");",- " },",- " );",- "}",- ""+ "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\":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",+ "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": []}