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-actionsd2d139820eff
diff --git a/postman/collection-json/archipel.postman_collection.json b/postman/collection-json/archipel.postman_collection.jsonindex a70b6a5549..aaf8da0885 100644--- a/postman/collection-json/archipel.postman_collection.json+++ b/postman/collection-json/archipel.postman_collection.json@@ -1530,7 +1530,7 @@"name": "Happy Cases","item": [{- "name": "Scenario10-Create 3DS payment without external 3ds authentication ",+ "name": "Scenario1-Create payment with confirm true","item": [{"name": "Payments - Create",@@ -1541,71 +1541,70 @@"exec": ["// Validate status 2xx","pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type","pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );","});","","// Validate if response has JSON Body","pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};","try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ " 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'\",",+ "// Response body should have value \"succeeded\" for \"status\"",+ "pm.test(",+ " \"[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": [+ ");",+ "",+ "// 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;",+ " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)",+ " },",+ ");",""],"type": "text/javascript"@@ -1631,7 +1630,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"authentication_type\":\"three_ds\",\"request_external_three_ds_authentication\":false,\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"FRA\",\"zip\":\"92200\",\"country\":\"FR\"},\"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\"}}}"+ "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {"raw": "{{baseUrl}}/payments",@@ -1647,29 +1646,27 @@"response": []},{- "name": "Payments - Confirm",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": [- "// Validate status 400",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 400\", function () {",- " pm.response.to.have.status(400);",+ "",+ "// 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/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -1679,48 +1676,51 @@" jsonData = pm.response.json();","} catch (e) {}","",- "// Validate if response has error body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has error body\", function () {",- " pm.expect(jsonData).to.have.property(\"error\");",- "});",+ "// Response body should have value \"Succeeded\" for \"status\"",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ ");","",- "// Validate if error type is \"invalid_request\"","pm.test(",- " \"[POST]::/payments/:id/confirm - Error type is 'invalid_request'\",",+ " \"[POST]::/payments/:id - Content check if value for 'amount' equal 500\","," function () {",- " pm.expect(jsonData.error).to.have.property(\"type\", \"invalid_request\");",+ " pm.expect(jsonData.amount).to.eql(500);"," },",");","",- "// Validate if error message is \"Payment method type not supported\"","pm.test(",- " \"[POST]::/payments/:id/confirm - Error message is 'Payment method type not supported'\",",+ " \"[POST]::/payments/:id - Content check if value for 'net_amount' equal 500\","," function () {",- " pm.expect(jsonData.error).to.have.property(",- " \"message\",",- " \"Payment method type not supported\",",- " );",+ " pm.expect(jsonData.net_amount).to.eql(500);"," },",");","",- "// Validate if error reason is \"Selected 3DS authentication method is not supported by archipel\"","pm.test(",- " \"[POST]::/payments/:id/confirm - Error reason is 'Selected 3DS authentication method is not supported by archipel'\",",+ " \"[POST]::/payments/:id - Content check if value for 'amount_capturable' equal 0\","," function () {",- " pm.expect(jsonData.error).to.have.property(",- " \"reason\",",- " \"Selected 3DS authentication method is not supported by archipel\",",- " );",+ " pm.expect(jsonData.amount_capturable).to.eql(0);"," },",- ");"- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'amount_received' equal 500\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(500);",+ " },",+ ");",+ "",+ "",+ "// 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"@@ -1728,55 +1728,27 @@}],"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_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"4242424242424242\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": ["payments",- ":id",- "confirm"+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }],"variable": [{@@ -1786,12 +1758,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 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 after confirm",+ "name": "Payments - Retrieve payment attempt","event": [{"listen": "test",@@ -1820,59 +1792,84 @@" jsonData = pm.response.json();","} catch (e) {}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'\",",+ "\"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },",");","",+ "// Response body should have \"connector_transaction_id\"","pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'amount' equal 500\",",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\","," function () {",- " pm.expect(jsonData.amount).to.eql(500);",+ " pm.expect(jsonData.connector_transaction_id).to.be.equal(",+ " pm.collectionVariables.get(\"connector_transaction_id\")",+ " );"," },",");","",+ "let payment_attempt = {}",+ "","pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'net_amount' equal 500\",",+ " \"[POST]::/payments - Payment has one 'Payment Attempt'\","," function () {",- " pm.expect(jsonData.net_amount).to.eql(500);",+ " pm.expect(jsonData.attempts.length).to.be.equal(1);",+ " payment_attempt = jsonData.attempts[0]"," },",");","","pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'amount_capturable' equal 0\",",+ " \"[POST]::/payments - Payment Attempt has 'charged' status\","," function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",+ " pm.expect(payment_attempt.status).to.be.equal(\"charged\");"," },",");","",- "// Response body should have \"connector_transaction_id\"",+ "","pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " \"[POST]::/payments - Payment Attempt has 'connector_transaction_id'\","," function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",+ " pm.expect(jsonData.connector_transaction_id).to.be.equal(",+ " pm.collectionVariables.get(\"connector_transaction_id\")",+ " );"," },",");",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {+ "",+ "pm.test(",+ " \"[POST]::/payments - Archiepl response 'transactionId' is updated and not null\",",+ " function () {",+ " pm.expect(payment_attempt.connector_metadata.transactionId).not.null",+ " pm.expect(payment_attempt.connector_metadata.transactionId).to.not.equal(",+ " pm.collectionVariables.get(\"archipel_transaction_uuid\")",+ " )",+ " pm.collectionVariables.set(\"archipel_transaction_uuid\", payment_attempt.connector_metadata.transactionId)",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments - Payment Attempt has no error\",",+ " function () {",+ " pm.expect(payment_attempt.error_message).to.be.null;",+ " },",+ ");",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {"key": "Accept","value": "application/json"}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments/:id?expand_attempts=true","host": ["{{baseUrl}}"],@@ -1882,7 +1879,7 @@],"query": [{- "key": "force_sync",+ "key": "expand_attempts","value": "true"}],@@ -1901,7 +1898,7 @@]},{- "name": "Scenario1-Create payment with confirm true",+ "name": "Scenario2-Create payment with confirm false","item": [{"name": "Payments - Create",@@ -1912,70 +1909,71 @@"exec": ["// Validate status 2xx","pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type","pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );","});","","// Validate if response has JSON Body","pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};","try {",- " jsonData = pm.response.json();",- "} catch (e) { }",+ " 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\"",- "pm.test(",- " \"[POST]::/payments - 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\",",+ "// 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(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },",- ");",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -2001,7 +1999,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {"raw": "{{baseUrl}}/payments",@@ -2017,13 +2015,12 @@"response": []},{- "name": "Payments - Retrieve",+ "name": "Payments - Retrieve with client secret","event": [{"listen": "test","script": {"exec": [- "","// Validate status 2xx","pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {"," pm.response.to.be.success;",@@ -2049,47 +2046,24 @@"","// Response body should have value \"Succeeded\" for \"status\"","pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ "\"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },",");","","pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'amount' equal 500\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(500);",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'net_amount' equal 500\",",- " function () {",- " pm.expect(jsonData.net_amount).to.eql(500);",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'amount_capturable' equal 0\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'amount_received' equal 500\",",+ " \"[POST]::/payments - Content check if no 'connector' is affected to the payment intent\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(500);",+ " pm.expect(jsonData.connector).to.be.null;"," },",");","",- "",- "// Response body should have \"connector_transaction_id\"",+ "// Response body should not have \"connector_transaction_id\"","pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' is null\","," function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",+ " pm.expect(jsonData.connector_transaction_id).to.be.null;"," },",");",""@@ -2099,6 +2073,26 @@}],"request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },"method": "GET","header": [{@@ -2107,7 +2101,7 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments/:id?client_secret={{client_secret}}","host": ["{{baseUrl}}"],@@ -2117,8 +2111,8 @@],"query": [{- "key": "force_sync",- "value": "true"+ "key": "client_secret",+ "value": "{{client_secret}}"}],"variable": [@@ -2134,7 +2128,7 @@"response": []},{- "name": "Payments - Retrieve payment attempt",+ "name": "Payments - Retrieve","event": [{"listen": "test",@@ -2165,64 +2159,24 @@"","// Response body should have value \"Succeeded\" for \"status\"","pm.test(",- "\"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ "\"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },",");","",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(jsonData.connector_transaction_id).to.be.equal(",- " pm.collectionVariables.get(\"connector_transaction_id\")",- " );",- " },",- ");",- "",- "let payment_attempt = {}",- "",- "pm.test(",- " \"[POST]::/payments - Payment has one 'Payment Attempt'\",",- " function () {",- " pm.expect(jsonData.attempts.length).to.be.equal(1);",- " payment_attempt = jsonData.attempts[0]",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has 'charged' status\",",- " function () {",- " pm.expect(payment_attempt.status).to.be.equal(\"charged\");",- " },",- ");",- "",- "",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has 'connector_transaction_id'\",",- " function () {",- " pm.expect(jsonData.connector_transaction_id).to.be.equal(",- " pm.collectionVariables.get(\"connector_transaction_id\")",- " );",- " },",- ");",- "","pm.test(",- " \"[POST]::/payments - Archiepl response 'transactionId' is updated and not null\",",+ " \"[POST]::/payments - Content check if no 'connector' is affected to the payment intent\","," function () {",- " pm.expect(payment_attempt.connector_metadata.transactionId).not.null",- " pm.expect(payment_attempt.connector_metadata.transactionId).to.not.equal(",- " pm.collectionVariables.get(\"archipel_transaction_uuid\")",- " )",- " pm.collectionVariables.set(\"archipel_transaction_uuid\", payment_attempt.connector_metadata.transactionId)",+ " pm.expect(jsonData.connector).to.be.null;"," },",");","",+ "// Response body should not have \"connector_transaction_id\"","pm.test(",- " \"[POST]::/payments - Payment Attempt has no error\",",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' is null\","," function () {",- " pm.expect(payment_attempt.error_message).to.be.null;",+ " pm.expect(jsonData.connector_transaction_id).to.be.null;"," },",");",""@@ -2240,7 +2194,7 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?expand_attempts=true",+ "raw": "{{baseUrl}}/payments/:id","host": ["{{baseUrl}}"],@@ -2248,12 +2202,6 @@"payments",":id"],- "query": [- {- "key": "expand_attempts",- "value": "true"- }- ],"variable": [{"key": "id",@@ -2265,33 +2213,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"},"response": []- }- ]- },- {- "name": "Scenario2-Create payment with confirm false",- "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.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.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -2301,41 +2247,29 @@" jsonData = pm.response.json();","} catch (e) {}","",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_payment_method\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ "// Response body should have value \"succeeded\" for \"status\"",+ "pm.test(",+ "\"[POST]::/payments/:id/confirm - 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\");"," },",- " );",- "}",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector' is archipel\",",+ " function () {",+ " pm.expect(jsonData.connector).to.be.equal(\"archipel\");",+ " },",+ ");",""],"type": "text/javascript"@@ -2352,6 +2286,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": [{@@ -2370,23 +2324,32 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"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": "Payments - Retrieve with client secret",+ "name": "Payments - Retrieve after confirm","event": [{"listen": "test",@@ -2417,24 +2380,47 @@"","// Response body should have value \"Succeeded\" for \"status\"","pm.test(",- "\"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },",");","","pm.test(",- " \"[POST]::/payments - Content check if no 'connector' is affected to the payment intent\",",+ " \"[POST]::/payments/:id - Content check if value for 'amount' equal 500\","," function () {",- " pm.expect(jsonData.connector).to.be.null;",+ " pm.expect(jsonData.amount).to.eql(500);"," },",");","",- "// Response body should not have \"connector_transaction_id\"","pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' is null\",",+ " \"[POST]::/payments/:id - Content check if value for 'net_amount' equal 500\","," function () {",- " pm.expect(jsonData.connector_transaction_id).to.be.null;",+ " pm.expect(jsonData.net_amount).to.eql(500);",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'amount_capturable' equal 0\",",+ " function () {",+ " pm.expect(jsonData.amount_capturable).to.eql(0);",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'amount_received' equal 500\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(500);",+ " },",+ ");",+ "",+ "",+ "// 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;"," },",");",""@@ -2444,26 +2430,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": [{@@ -2472,7 +2438,7 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?client_secret={{client_secret}}",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],@@ -2482,8 +2448,8 @@],"query": [{- "key": "client_secret",- "value": "{{client_secret}}"+ "key": "force_sync",+ "value": "true"}],"variable": [@@ -2499,7 +2465,7 @@"response": []},{- "name": "Payments - Retrieve",+ "name": "Payments - Retrieve with connector sync","event": [{"listen": "test",@@ -2530,24 +2496,64 @@"","// Response body should have value \"Succeeded\" for \"status\"","pm.test(",- "\"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'\",",+ "\"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },",");","",+ "// Response body should have \"connector_transaction_id\"","pm.test(",- " \"[POST]::/payments - Content check if no 'connector' is affected to the payment intent\",",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\","," function () {",- " pm.expect(jsonData.connector).to.be.null;",+ " pm.expect(jsonData.connector_transaction_id).to.be.equal(",+ " pm.collectionVariables.get(\"connector_transaction_id\")",+ " );"," },",");","",- "// Response body should not have \"connector_transaction_id\"",+ "let payment_attempt = {}",+ "","pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' is null\",",+ " \"[POST]::/payments - Payment has one 'Payment Attempt'\","," function () {",- " pm.expect(jsonData.connector_transaction_id).to.be.null;",+ " pm.expect(jsonData.attempts.length).to.be.equal(1);",+ " payment_attempt = jsonData.attempts[0]",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments - Payment Attempt has 'charged' status\",",+ " function () {",+ " pm.expect(payment_attempt.status).to.be.equal(\"charged\");",+ " },",+ ");",+ "",+ "",+ "pm.test(",+ " \"[POST]::/payments - Payment Attempt has 'connector_transaction_id'\",",+ " function () {",+ " pm.expect(jsonData.connector_transaction_id).to.be.equal(",+ " pm.collectionVariables.get(\"connector_transaction_id\")",+ " );",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments - Archiepl response 'transactionId' is updated and not null\",",+ " function () {",+ " pm.expect(payment_attempt.connector_metadata.transactionId).not.null",+ " pm.expect(payment_attempt.connector_metadata.transactionId).to.not.equal(",+ " pm.collectionVariables.get(\"archipel_transaction_uuid\")",+ " )",+ " pm.collectionVariables.set(\"archipel_transaction_uuid\", payment_attempt.connector_metadata.transactionId)",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments - Payment Attempt has no error\",",+ " function () {",+ " pm.expect(payment_attempt.error_message).to.be.null;"," },",");",""@@ -2565,7 +2571,7 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id",+ "raw": "{{baseUrl}}/payments/:id?expand_attempts=true","host": ["{{baseUrl}}"],@@ -2573,6 +2579,12 @@"payments",":id"],+ "query": [+ {+ "key": "expand_attempts",+ "value": "true"+ }+ ],"variable": [{"key": "id",@@ -2584,32 +2596,158 @@"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": "Scenario3a-Create payment with Manual capture",+ "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\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"requires_capture\" for \"status\"",+ "pm.test(",+ "\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ "function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ "},",+ ");",+ "",+ "// Response body should have \"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;",+ " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)",+ " },",+ ");"+ ],+ "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\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"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 - 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",@@ -2618,14 +2756,72 @@" 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\"","pm.test(",- "\"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",- " function () {",+ "\"[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 \"500\" for \"amount\"",+ "pm.test(",+ "\"[post]:://payments/:id/capture - Content check if value for 'amount' matches '500'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(500);",+ " },",+ ");",+ "",+ "// Response body should have value \"500\" for \"net_amount\"",+ "pm.test(",+ "\"[post]:://payments/:id/capture - Content check if value for 'net_amount' matches '500'\",",+ " function () {",+ " pm.expect(jsonData.net_amount).to.eql(500);",+ " },",+ ");",+ "",+ "// Response body should have value \"500\" for \"amount_capturable\"",+ "pm.test(",+ "\"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches '0'\",",+ " function () {",+ " pm.expect(jsonData.amount_capturable).to.eql(0);",+ " },",+ ");",+ "",+ "pm.test(",+ "\"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 500\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(500);"," },",");","",+ "","pm.test("," \"[POST]::/payments - Content check if 'connector_transaction_id' exists\","," function () {",@@ -2641,6 +2837,7 @@" pm.expect(jsonData.connector).to.be.equal(\"archipel\");"," },",");",+ "",""],"type": "text/javascript"@@ -2657,26 +2854,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": [{@@ -2695,32 +2872,31 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"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\":500,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": ["payments",":id",- "confirm"+ "capture"],"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{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 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 after confirm",+ "name": "Payments - Sync payment","event": [{"listen": "test",@@ -2793,8 +2969,7 @@" pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be"," .true;"," },",- ");",- ""+ ");"],"type": "text/javascript"}@@ -2836,7 +3011,7 @@"response": []},{- "name": "Payments - Retrieve with connector sync",+ "name": "Payments - Check payment attempt","event": [{"listen": "test",@@ -2865,23 +3040,6 @@" jsonData = pm.response.json();","} catch (e) {}","",- "// Response body should have value \"Succeeded\" for \"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(jsonData.connector_transaction_id).to.be.equal(",- " pm.collectionVariables.get(\"connector_transaction_id\")",- " );",- " },",- ");","","let payment_attempt = {}","",@@ -2910,24 +3068,13 @@" },",");","",+ "","pm.test(",- " \"[POST]::/payments - Archiepl response 'transactionId' is updated and not null\",",- " function () {",- " pm.expect(payment_attempt.connector_metadata.transactionId).not.null",- " pm.expect(payment_attempt.connector_metadata.transactionId).to.not.equal(",- " pm.collectionVariables.get(\"archipel_transaction_uuid\")",- " )",- " pm.collectionVariables.set(\"archipel_transaction_uuid\", payment_attempt.connector_metadata.transactionId)",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has no error\",",+ " \"[POST]::/payments - Payment Attempt has no error\","," function () {"," pm.expect(payment_attempt.error_message).to.be.null;"," },",- ");",- ""+ ");"],"type": "text/javascript"}@@ -2971,7 +3118,7 @@]},{- "name": "Scenario3a-Create payment with Manual capture",+ "name": "Scenario3b-Create payment with partial capture","item": [{"name": "Payments - Create",@@ -3030,12 +3177,14 @@"}","","// Response body should have value \"requires_capture\" for \"status\"",- "pm.test(",- "\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- "function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- "},",- ");",+ "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\");",+ " },",+ " );",+ "}","","// Response body should have \"connector_transaction_id\"","pm.test(",@@ -3153,11 +3302,11 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"partially_captured\" for \"status\"","pm.test(",- "\"[POST]:://payments/:id/capture - 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\");","},",");","",@@ -3186,9 +3335,9 @@");","","pm.test(",- "\"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 500\",",+ "\"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 200\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(500);",+ " pm.expect(jsonData.amount_received).to.eql(200);"," },",");","",@@ -3207,9 +3356,7 @@" function () {"," pm.expect(jsonData.connector).to.be.equal(\"archipel\");"," },",- ");",- "",- ""+ ");"],"type": "text/javascript"}@@ -3243,7 +3390,7 @@"language": "json"}},- "raw": "{\"amount_to_capture\":500,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"+ "raw": "{\"amount_to_capture\":200,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"},"url": {"raw": "{{baseUrl}}/payments/:id/capture",@@ -3296,11 +3443,11 @@" jsonData = pm.response.json();","} catch (e) {}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"partially_captured\" for \"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\");"," },",");","",@@ -3328,7 +3475,7 @@"pm.test("," \"[POST]::/payments/:id - Content check if value for 'amount_received' equal 500\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(500);",+ " pm.expect(jsonData.amount_received).to.eql(200);"," },",");","",@@ -3340,7 +3487,9 @@" pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be"," .true;"," },",- ");"+ ");",+ "",+ ""],"type": "text/javascript"}@@ -3423,9 +3572,9 @@");","","pm.test(",- " \"[POST]::/payments - Payment Attempt has 'charged' status\",",+ " \"[POST]::/payments - Payment Attempt has 'partial_charged' status\","," function () {",- " pm.expect(payment_attempt.status).to.be.equal(\"charged\");",+ " pm.expect(payment_attempt.status).to.be.equal(\"partial_charged\");"," },",");","",@@ -3489,7 +3638,7 @@]},{- "name": "Scenario3b-Create payment with partial capture",+ "name": "Scenario3c-Create payment with confirm false and manual capture","item": [{"name": "Payments - Create",@@ -3519,7 +3668,7 @@"let jsonData = {};","try {"," jsonData = pm.response.json();",- "} catch (e) {}",+ "} catch (e) { }","","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {",@@ -3547,15 +3696,13 @@" );","}","",- "// 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\");",- " },",- " );",- "}",+ "// Response body should have value \"requires_confirmation\" for \"status\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",+ " },",+ ");","","// Response body should have \"connector_transaction_id\"","pm.test(",@@ -3599,7 +3746,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {"raw": "{{baseUrl}}/payments",@@ -3614,6 +3761,140 @@},"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) { }",+ "",+ "// Response body should have value \"requires_capture\" for \"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 'connector_transaction_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector' is archipel\",",+ " function () {",+ " pm.expect(jsonData.connector).to.be.equal(\"archipel\");",+ " },",+ ");",+ ""+ ],+ "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": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"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",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id",+ "confirm"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }+ ]+ },+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ },+ "response": []+ },{"name": "Payments - Capture","event": [@@ -3673,11 +3954,11 @@" );","}","",- "// Response body should have value \"partially_captured\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","pm.test(",- "\"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\",",+ "\"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\",","function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");","},",");","",@@ -3706,9 +3987,9 @@");","","pm.test(",- "\"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 200\",",+ "\"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 500\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(200);",+ " pm.expect(jsonData.amount_received).to.eql(500);"," },",");","",@@ -3727,7 +4008,9 @@" function () {"," pm.expect(jsonData.connector).to.be.equal(\"archipel\");"," },",- ");"+ ");",+ "",+ ""],"type": "text/javascript"}@@ -3761,7 +4044,7 @@"language": "json"}},- "raw": "{\"amount_to_capture\":200,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"+ "raw": "{\"amount_to_capture\":500,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"},"url": {"raw": "{{baseUrl}}/payments/:id/capture",@@ -3785,7 +4068,7 @@"response": []},{- "name": "Payments - Sync payment",+ "name": "Payments - Check payment attempt","event": [{"listen": "test",@@ -3814,53 +4097,41 @@" jsonData = pm.response.json();","} catch (e) {}","",- "// Response body should have value \"partially_captured\" for \"status\"",- "pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " },",- ");",+ "",+ "let payment_attempt = {}","","pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'amount' equal 500\",",+ " \"[POST]::/payments - Payment has one 'Payment Attempt'\","," function () {",- " pm.expect(jsonData.amount).to.eql(500);",+ " pm.expect(jsonData.attempts.length).to.be.equal(1);",+ " payment_attempt = jsonData.attempts[0]"," },",");","","pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'net_amount' equal 500\",",+ " \"[POST]::/payments - Payment Attempt has 'charged' status\","," function () {",- " pm.expect(jsonData.net_amount).to.eql(500);",+ " pm.expect(payment_attempt.status).to.be.equal(\"charged\");"," },",");","",+ "","pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'amount_capturable' equal 0\",",+ " \"[POST]::/payments - Payment Attempt has 'connector_transaction_id'\","," function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'amount_received' equal 500\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(200);",+ " pm.expect(jsonData.connector_transaction_id).to.be.equal(",+ " pm.collectionVariables.get(\"connector_transaction_id\")",+ " );"," },",");","","",- "// Response body should have \"connector_transaction_id\"","pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " \"[POST]::/payments - Payment Attempt has no error\","," function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",+ " pm.expect(payment_attempt.error_message).to.be.null;"," },",- ");",- "",- ""+ ");"],"type": "text/javascript"}@@ -3875,7 +4146,7 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments/:id?expand_attempts=true","host": ["{{baseUrl}}"],@@ -3884,6 +4155,10 @@":id"],"query": [+ {+ "key": "expand_attempts",+ "value": "true"+ },{"key": "force_sync","value": "true"@@ -3900,28 +4175,33 @@"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": "Scenario4a-Void a payment",+ "item": [{- "name": "Payments - Check payment attempt",+ "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();","});","",@@ -3931,107 +4211,117 @@" 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.\",",+ " );",+ "}","",- "let payment_attempt = {}",- "",- "pm.test(",- " \"[POST]::/payments - Payment has one 'Payment Attempt'\",",- " function () {",- " pm.expect(jsonData.attempts.length).to.be.equal(1);",- " payment_attempt = jsonData.attempts[0]",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has 'partial_charged' status\",",- " function () {",- " pm.expect(payment_attempt.status).to.be.equal(\"partial_charged\");",- " },",- ");",- "",- "",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has 'connector_transaction_id'\",",- " function () {",- " pm.expect(jsonData.connector_transaction_id).to.be.equal(",- " pm.collectionVariables.get(\"connector_transaction_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 {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}","",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has no error\",",- " function () {",- " pm.expect(payment_attempt.error_message).to.be.null;",- " },",- ");"+ "// Response body should have value \"requires_confirmation\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",+ " },",+ " );",+ "}",+ ""],"type": "text/javascript"}}],"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\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?expand_attempts=true",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "expand_attempts",- "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"+ }},"response": []- }- ]- },- {- "name": "Scenario3c-Create payment with confirm false and manual capture",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Cancel","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - 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(\"[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/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 - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -4039,7 +4329,7 @@"let jsonData = {};","try {"," jsonData = pm.response.json();",- "} catch (e) { }",+ "} catch (e) {}","","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {",@@ -4067,31 +4357,15 @@" );","}","",- "// Response body should have value \"requires_confirmation\" for \"status\"",- "pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",- " },",- ");",- "",- "// Response body should have \"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;",- " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)",- " },",- ");"- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [+ "// 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"@@ -4117,45 +4391,51 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/cancel","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "cancel"+ ],+ "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": "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": "Payments - Confirm",+ "name": "Payments - Retrieve","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\",",- " );",- " },",- ");",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -4163,40 +4443,180 @@"let jsonData = {};","try {"," jsonData = pm.response.json();",- "} catch (e) { }",+ "} catch (e) {}","",- "// Response body should have value \"requires_capture\" for \"status\"",- "pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- ");",+ "// 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.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_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 {{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.test(",- " \"[POST]::/payments - Content check if 'connector' is archipel\",",- " function () {",- " pm.expect(jsonData.connector).to.be.equal(\"archipel\");",- " },",- ");",+ "// 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 - Content check if value for 'status' matches 'cancelled'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"cancelled\");",+ " },",+ " );",+ "}",""],"type": "text/javascript"}+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {+ "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }+ ]},+ "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ },+ "response": []+ }+ ]+ },+ {+ "name": "Scenario4b-Void a partially captured payment",+ "item": [+ {+ "name": "Payments - Create",+ "event": [{- "listen": "prerequest",+ "listen": "test","script": {"exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"requires_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"@@ -4204,26 +4624,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": [{@@ -4242,27 +4642,17 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"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\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"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"+ }},"response": []},@@ -4325,11 +4715,11 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"partially_captured\" for \"status\"","pm.test(",- "\"[POST]:://payments/:id/capture - 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\");","},",");","",@@ -4358,9 +4748,9 @@");","","pm.test(",- "\"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 500\",",+ "\"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 200\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(500);",+ " pm.expect(jsonData.amount_received).to.eql(200);"," },",");","",@@ -4379,9 +4769,7 @@" function () {"," pm.expect(jsonData.connector).to.be.equal(\"archipel\");"," },",- ");",- "",- ""+ ");"],"type": "text/javascript"}@@ -4415,7 +4803,7 @@"language": "json"}},- "raw": "{\"amount_to_capture\":500,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"+ "raw": "{\"amount_to_capture\":200,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"},"url": {"raw": "{{baseUrl}}/payments/:id/capture",@@ -4439,260 +4827,29 @@"response": []},{- "name": "Payments - Check payment attempt",+ "name": "Payments - Cancel","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/cancel - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/cancel - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");","","// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "",- "let payment_attempt = {}",- "",- "pm.test(",- " \"[POST]::/payments - Payment has one 'Payment Attempt'\",",- " function () {",- " pm.expect(jsonData.attempts.length).to.be.equal(1);",- " payment_attempt = jsonData.attempts[0]",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has 'charged' status\",",- " function () {",- " pm.expect(payment_attempt.status).to.be.equal(\"charged\");",- " },",- ");",- "",- "",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has 'connector_transaction_id'\",",- " function () {",- " pm.expect(jsonData.connector_transaction_id).to.be.equal(",- " pm.collectionVariables.get(\"connector_transaction_id\")",- " );",- " },",- ");",- "",- "",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has no error\",",- " function () {",- " pm.expect(payment_attempt.error_message).to.be.null;",- " },",- ");"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?expand_attempts=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "expand_attempts",- "value": "true"- },- {- "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": "Scenario4a-Void a payment",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_confirmation\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",- " },",- " );",- "}",- ""- ],- "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\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- }- },- "response": []- },- {- "name": "Payments - Cancel",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "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(",- " \"[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.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -4908,7 +5065,7 @@]},{- "name": "Scenario4b-Void a partially captured payment",+ "name": "Scenario4c-Void a successful payment","item": [{"name": "Payments - Create",@@ -4953,19 +5110,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);",@@ -4980,14 +5124,30 @@"}","","// 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\");",- " },",- " );",- "}",+ "pm.test(",+ "\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ "function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ "},",+ ");",+ "",+ "// Response body should have \"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;",+ " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)",+ " },",+ ");"+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -5013,7 +5173,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {"raw": "{{baseUrl}}/payments",@@ -5023,7 +5183,8 @@"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": []},@@ -5086,11 +5247,11 @@" );","}","",- "// Response body should have value \"partially_captured\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","pm.test(",- "\"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\",",+ "\"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\",","function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");","},",");","",@@ -5119,9 +5280,9 @@");","","pm.test(",- "\"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 200\",",+ "\"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 500\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(200);",+ " pm.expect(jsonData.amount_received).to.eql(500);"," },",");","",@@ -5140,7 +5301,9 @@" function () {"," pm.expect(jsonData.connector).to.be.equal(\"archipel\");"," },",- ");"+ ");",+ "",+ ""],"type": "text/javascript"}@@ -5174,7 +5337,7 @@"language": "json"}},- "raw": "{\"amount_to_capture\":200,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"+ "raw": "{\"amount_to_capture\":500,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"},"url": {"raw": "{{baseUrl}}/payments/:id/capture",@@ -5198,18 +5361,133 @@"response": []},{- "name": "Payments - Cancel",+ "name": "Payments - Sync payment","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/cancel - 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]::/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) {}",+ "",+ "// Response body should have value \"Succeeded\" for \"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/:id - Content check if value for 'amount' equal 500\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(500);",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'net_amount' equal 500\",",+ " function () {",+ " pm.expect(jsonData.net_amount).to.eql(500);",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'amount_capturable' equal 0\",",+ " function () {",+ " pm.expect(jsonData.amount_capturable).to.eql(0);",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'amount_received' equal 500\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(500);",+ " },",+ ");",+ "",+ "",+ "// Response body should have \"connector_transaction_id\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " },",+ ");"+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {+ "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }+ ]+ },+ "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ },+ "response": []+ },+ {+ "name": "Payments - Cancel",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 400",+ "pm.test(\"[POST]::/payments/:id/cancel - Status code is 400\", function () {",+ " pm.response.to.have.status(400);",+ "});",+ "",+ "// Validate if response header has matching content-type","pm.test("," \"[POST]::/payments/:id/cancel - Content-Type is application/json\","," function () {",@@ -5224,48 +5502,29 @@" 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.\",",- " );",- "}",+ "// Validate if response has error body",+ "pm.test(\"[POST]::/payments/:id/cancel - Response has error body\", function () {",+ " pm.expect(pm.response.json()).to.have.property(\"error\");",+ "});","",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",+ "// Validate if response has \"invalid_request\" error type",+ "pm.test(",+ " \"[POST]::/payments/:id/cancel - Response has 'invalid_request' error type\",",+ " function () {",+ " pm.expect(pm.response.json().error).to.have.property(\"type\", \"invalid_request\");",+ " },",+ ");","",- "// 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\");",- " },",- " );",- "}",- ""+ "// Validate if response has \"You cannot cancel this payment because it has status succeeded\" error message",+ "pm.test(",+ " \"[POST]::/payments/:id/cancel - Response has 'You cannot cancel this payment because it has status succeeded' error message\",",+ " function () {",+ " pm.expect(pm.response.json().error).to.have.property(",+ " \"message\",",+ " \"You cannot cancel this payment because it has status succeeded\",",+ " );",+ " },",+ ");"],"type": "text/javascript"}@@ -5313,595 +5572,97 @@"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": "Scenario5a-Create a zero auth mandate and recurring payment (using mandate_id)",+ "item": [{- "name": "Payments - Retrieve",+ "name": "Mandate Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","",- "// Validate if response has JSON Body",- "pm.test(\"[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) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario4c-Void a successful payment",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "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 \"requires_capture\" for \"status\"",- "pm.test(",- "\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- "function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- "},",- ");",- "",- "// Response body should have \"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;",- " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)",- " },",- ");"- ],- "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\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"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 - 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\",",- " );",- " },",- ");",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};","",- "// 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) {}",+ "// 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\");",+ "})};","",- "// 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\"",- "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 \"500\" for \"amount\"",- "pm.test(",- "\"[post]:://payments/:id/capture - Content check if value for 'amount' matches '500'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(500);",- " },",- ");",- "",- "// Response body should have value \"500\" for \"net_amount\"",- "pm.test(",- "\"[post]:://payments/:id/capture - Content check if value for 'net_amount' matches '500'\",",- " function () {",- " pm.expect(jsonData.net_amount).to.eql(500);",- " },",- ");",- "",- "// Response body should have value \"500\" for \"amount_capturable\"",- "pm.test(",- "\"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches '0'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- ");",- "",- "pm.test(",- "\"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 500\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(500);",- " },",- ");",- "",- "",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector' is archipel\",",- " function () {",- " pm.expect(jsonData.connector).to.be.equal(\"archipel\");",- " },",- ");",- "",- ""- ],- "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_to_capture\":500,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/capture",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "capture"- ],- "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"- },- "response": []- },- {- "name": "Payments - Sync payment",- "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) {}",- "",- "// Response body should have value \"Succeeded\" for \"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/:id - Content check if value for 'amount' equal 500\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(500);",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'net_amount' equal 500\",",- " function () {",- " pm.expect(jsonData.net_amount).to.eql(500);",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'amount_capturable' equal 0\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'amount_received' equal 500\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(500);",- " },",- ");",- "",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- },- {- "name": "Payments - Cancel",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 400",- "pm.test(\"[POST]::/payments/:id/cancel - Status code is 400\", function () {",- " pm.response.to.have.status(400);",- "});",- "",- "// 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\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Validate if response has error body",- "pm.test(\"[POST]::/payments/:id/cancel - Response has error body\", function () {",- " pm.expect(pm.response.json()).to.have.property(\"error\");",- "});",- "",- "// Validate if response has \"invalid_request\" error type",- "pm.test(",- " \"[POST]::/payments/:id/cancel - Response has 'invalid_request' error type\",",- " function () {",- " pm.expect(pm.response.json().error).to.have.property(\"type\", \"invalid_request\");",- " },",- ");",- "",- "// Validate if response has \"You cannot cancel this payment because it has status succeeded\" error message",- "pm.test(",- " \"[POST]::/payments/:id/cancel - Response has 'You cannot cancel this payment because it has status succeeded' error message\",",- " function () {",- " pm.expect(pm.response.json().error).to.have.property(",- " \"message\",",- " \"You cannot cancel this payment because it has status 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": {+ "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": [{@@ -5920,37 +5681,23 @@"language": "json"}},- "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"+ "raw": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"profile_id\":\"{{profile_id}}\",\"name\":\"John Doe\",\"setup_future_usage\":\"off_session\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"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\"}]}"},"url": {- "raw": "{{baseUrl}}/payments/:id/cancel",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "cancel"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "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": "Scenario5a-Create a zero auth mandate and recurring payment (using mandate_id)",- "item": [+ },{- "name": "Mandate Payments - Create",+ "name": "Payments - Confirm","event": [{"listen": "test",@@ -5983,6 +5730,15 @@" 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);",@@ -5991,11 +5747,10 @@" console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');","};","",- "",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\", function() {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");","})};","","// Response body should have \"mandate_id\"",@@ -6043,6 +5798,12 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "publishable_key",+ "value": "{{publishable_key}}",+ "type": "text",+ "disabled": true}],"body": {@@ -6052,23 +5813,31 @@"language": "json"}},- "raw": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"profile_id\":\"{{profile_id}}\",\"name\":\"John Doe\",\"setup_future_usage\":\"off_session\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"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\"}]}"+ "raw": "{\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"5185570141917102\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"125.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"multi_use\":{\"amount\":1000,\"currency\":\"USD\",\"start_date\":\"2023-04-21T00:00:00Z\",\"end_date\":\"2023-05-21T00:00:00Z\",\"metadata\":{\"frequency\":\"13\"}}}}}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "confirm"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}"+ }]},- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []},{- "name": "Payments - Confirm",+ "name": "Recurring Payments - Create","event": [{"listen": "test",@@ -6118,6 +5887,7 @@" 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() {",@@ -6133,6 +5903,114 @@"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\":500,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"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\":\"joseph\"}},\"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": "Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)",+ "item": [+ {+ "name": "Mandate Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});",+ "",+ "// Validate if response has JSON Body ",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {jsonData = pm.response.json();}catch(e){}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",+ "};",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(\"- use {{client_secret}} as collection variable for value\",jsonData.client_secret);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};",+ "",+ "",+ "// Response body should have value \"requires_payment_method\" for \"status\"",+ "if (jsonData?.status) {",+ "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ "})};",+ "",+ "// 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"@@ -6169,12 +6047,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "publishable_key",- "value": "{{publishable_key}}",- "type": "text",- "disabled": true}],"body": {@@ -6184,31 +6056,23 @@"language": "json"}},- "raw": "{\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"5185570141917102\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"125.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"multi_use\":{\"amount\":1000,\"currency\":\"USD\",\"start_date\":\"2023-04-21T00:00:00Z\",\"end_date\":\"2023-05-21T00:00:00Z\",\"metadata\":{\"frequency\":\"13\"}}}}}"+ "raw": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"profile_id\":\"{{profile_id}}\",\"name\":\"John Doe\",\"setup_future_usage\":\"off_session\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"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\"}]}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{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": "Recurring Payments - Create",+ "name": "Payments - Confirm","event": [{"listen": "test",@@ -6258,7 +6122,6 @@" 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() {",@@ -6274,11 +6137,6 @@"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"@@ -6286,6 +6144,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": [{@@ -6295,6 +6173,12 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "publishable_key",+ "value": "{{publishable_key}}",+ "type": "text",+ "disabled": true}],"body": {@@ -6304,28 +6188,31 @@"language": "json"}},- "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"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\":\"joseph\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"5185570141917102\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\"}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "confirm"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}"+ }]},- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []- }- ]- },- {- "name": "Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)",- "item": [+ },{- "name": "Mandate Payments - Create",+ "name": "Recurring Payments - Create","event": [{"listen": "test",@@ -6382,6 +6269,11 @@"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"@@ -6389,26 +6281,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": [{@@ -6427,7 +6299,7 @@"language": "json"}},- "raw": "{\"amount\":0,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"profile_id\":\"{{profile_id}}\",\"name\":\"John Doe\",\"setup_future_usage\":\"off_session\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"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\"}]}"+ "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"setup_future_usage\":\"off_session\",\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {"raw": "{{baseUrl}}/payments",@@ -6443,7 +6315,111 @@"response": []},{- "name": "Payments - Confirm",+ "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"+ ],+ "query": [+ {+ "key": "accepted_country",+ "value": "co",+ "disabled": true+ },+ {+ "key": "accepted_country",+ "value": "pa",+ "disabled": true+ },+ {+ "key": "accepted_currency",+ "value": "voluptate ea",+ "disabled": true+ },+ {+ "key": "accepted_currency",+ "value": "exercitation",+ "disabled": true+ },+ {+ "key": "minimum_amount",+ "value": "100",+ "disabled": true+ },+ {+ "key": "maximum_amount",+ "value": "10000000",+ "disabled": true+ },+ {+ "key": "recurring_payment_enabled",+ "value": "true",+ "disabled": true+ },+ {+ "key": "installment_payment_enabled",+ "value": "true",+ "disabled": true+ }+ ],+ "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": "Recurring Payments - Confirm","event": [{"listen": "test",@@ -6559,7 +6535,7 @@"language": "json"}},- "raw": "{\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"5185570141917102\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\"}"+ "raw": "{\"customer_id\":\"{{customer_id}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\"}"},"url": {"raw": "{{baseUrl}}/payments/:id/confirm",@@ -6581,70 +6557,116 @@"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": "Scenario6a-Create a mandate and recurring payment (using mandate_id)",+ "item": [{- "name": "Recurring 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 mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}","","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(\"- use {{client_secret}} as collection variable for value\",jsonData.client_secret);",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );","} else {",- " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",- "};",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- "})};",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}","","// Response body should have \"mandate_id\"",- "pm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {",- " pm.expect((typeof jsonData.mandate_id !== \"undefined\")).to.be.true;",- "});",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",+ " },",+ ");","","// Response body should have \"mandate_data\"",- "pm.test(\"[POST]::/payments - Content check if 'mandate_data' exists\", function() {",- " pm.expect((typeof jsonData.mandate_data !== \"undefined\")).to.be.true;",- "});",- "",- "// Response body should have \"payment_method_data\"",- "pm.test(\"[POST]::/payments - Content check if 'payment_method_data' exists\", function() {",- " pm.expect((typeof jsonData.payment_method_data !== \"undefined\")).to.be.true;",- "});",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",+ " },",+ ");",""],"type": "text/javascript"@@ -6670,7 +6692,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"setup_future_usage\":\"off_session\",\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"5185570141917102\",\"card_exp_month\":\"10\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"123\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"single_use\":{\"amount\":7000,\"currency\":\"USD\"}}},\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\"}},\"statement_descriptor_name\":\"Joseph Doe\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {"raw": "{{baseUrl}}/payments",@@ -6686,32 +6708,100 @@"response": []},{- "name": "List payment methods for a Customer",+ "name": "Payments - Retrieve","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]::/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/:customer_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 = {};",- "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.');",- "}"+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"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"}@@ -6726,135 +6816,134 @@}],"url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "customers",- ":customer_id",- "payment_methods"+ "payments",+ ":id"],"query": [{- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true+ "key": "force_sync",+ "value": "true"}],"variable": [{- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"+ "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 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 - Confirm",+ "name": "Recurring Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",+ "// Validate status 2xx","pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type","pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );","});","",- "// Validate if response has JSON Body ",+ "// Validate if response has JSON Body","pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {jsonData = pm.response.json();}catch(e){}",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}","","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );","} else {",- " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",- "};",- "",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}","","// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id","if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(\"- use {{mandate_id}} as collection variable for value\",jsonData.mandate_id);",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );","} else {",- " console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.');",- "};",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}","","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(\"- use {{client_secret}} as collection variable for value\",jsonData.client_secret);",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );","} else {",- " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",- "};",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","","// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - 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;",+ " },",+ ");",+ "",+ "// 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"@@ -6862,26 +6951,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": [{@@ -6891,12 +6960,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "publishable_key",- "value": "{{publishable_key}}",- "type": "text",- "disabled": true}],"body": {@@ -6906,55 +6969,42 @@"language": "json"}},- "raw": "{\"customer_id\":\"{{customer_id}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\"}"+ "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"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\":\"joseph\"}},\"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}}"- }+ "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": "Scenario6a-Create a mandate and recurring payment (using mandate_id)",- "item": [+ },{- "name": "Payments - Create",+ "name": "Recurring 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();","});","",@@ -7003,20 +7053,10 @@" );","}","",- "// 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 \"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\");"," },",@@ -7045,6 +7085,130 @@}],"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": "Scenario6b-Create a mandate and recurring payment (using connector agnostic)",+ "item": [+ {+ "name": "Mandate Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});",+ "",+ "// Validate if response has JSON Body ",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {jsonData = pm.response.json();}catch(e){}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",+ "};",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(\"- use {{client_secret}} as collection variable for value\",jsonData.client_secret);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};",+ "",+ "",+ "// Response body should have value \"requires_payment_method\" for \"status\"",+ "if (jsonData?.status) {",+ "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ "})};",+ "",+ "// Response body should have \"mandate_id\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_id !== \"undefined\")).to.be.true;",+ "});",+ "",+ "// Response body should have \"mandate_data\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_data' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_data !== \"undefined\")).to.be.true;",+ "});",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{api_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },"method": "POST","header": [{@@ -7063,7 +7227,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"5185570141917102\",\"card_exp_month\":\"10\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"123\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"single_use\":{\"amount\":7000,\"currency\":\"USD\"}}},\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\"}},\"statement_descriptor_name\":\"Joseph Doe\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"profile_id\":\"{{profile_id}}\",\"name\":\"John Doe\",\"setup_future_usage\":\"off_session\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"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\"}]}"},"url": {"raw": "{{baseUrl}}/payments",@@ -7079,99 +7243,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,",- " );",+ " 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,",- " );",+ "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.\",",- " );",- "}",+ " 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"@@ -7179,37 +7315,70 @@}],"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": "publishable_key",+ "value": "{{publishable_key}}",+ "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\":\"5185570141917102\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\"}"+ },"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": []},@@ -7220,101 +7389,62 @@"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\");",- " },",- " );",- "}",+ "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;",+ "});","","// 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"@@ -7340,7 +7470,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"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\":\"joseph\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"setup_future_usage\":\"off_session\",\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {"raw": "{{baseUrl}}/payments",@@ -7356,100 +7486,32 @@"response": []},{- "name": "Recurring 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 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 mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",+ "// Validate status 2xx ",+ "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});","",- "// Response body should have value \"Succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payment_methods/:customer_id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});","",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {jsonData = pm.response.json();}catch(e){}","",- "// 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_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"}@@ -7464,39 +7526,71 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"+ "customers",+ ":customer_id",+ "payment_methods"],"query": [{- "key": "force_sync",- "value": "true"+ "key": "accepted_country",+ "value": "co",+ "disabled": true+ },+ {+ "key": "accepted_country",+ "value": "pa",+ "disabled": true+ },+ {+ "key": "accepted_currency",+ "value": "voluptate ea",+ "disabled": true+ },+ {+ "key": "accepted_currency",+ "value": "exercitation",+ "disabled": true+ },+ {+ "key": "minimum_amount",+ "value": "100",+ "disabled": true+ },+ {+ "key": "maximum_amount",+ "value": "10000000",+ "disabled": true+ },+ {+ "key": "recurring_payment_enabled",+ "value": "true",+ "disabled": true+ },+ {+ "key": "installment_payment_enabled",+ "value": "true",+ "disabled": true}],"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": "Scenario6b-Create a mandate and recurring payment (using connector agnostic)",- "item": [+ },{- "name": "Mandate Payments - Create",+ "name": "Recurring Payments - Confirm","event": [{"listen": "test",@@ -7529,6 +7623,15 @@" 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);",@@ -7537,11 +7640,10 @@" console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');","};","",- "",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\", function() {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");","})};","","// Response body should have \"mandate_id\"",@@ -7589,6 +7691,12 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "publishable_key",+ "value": "{{publishable_key}}",+ "type": "text",+ "disabled": true}],"body": {@@ -7598,23 +7706,36 @@"language": "json"}},- "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"profile_id\":\"{{profile_id}}\",\"name\":\"John Doe\",\"setup_future_usage\":\"off_session\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"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\"}]}"+ "raw": "{\"customer_id\":\"{{customer_id}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\"}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "confirm"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}"+ }]},- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario7-Save card flow",+ "item": [{- "name": "Payments - Confirm",+ "name": "Payments - Create","event": [{"listen": "test",@@ -7664,48 +7785,28 @@" 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 \"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;",- "});",- ""+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}"],"type": "text/javascript"}}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -7715,12 +7816,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "publishable_key",- "value": "{{publishable_key}}",- "type": "text",- "disabled": true}],"body": {@@ -7730,92 +7825,134 @@"language": "json"}},- "raw": "{\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"5185570141917102\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\"}"+ "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"customer_id\":\"{{customer_id}}\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"online\",\"accepted_at\":\"2022-09-10T10:11:12Z\",\"online\":{\"ip_address\":\"123.32.25.123\",\"user_agent\":\"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"5185570141917102\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John 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\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{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": "Recurring Payments - Create",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );","});","",- "// Validate if response has JSON Body ",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {jsonData = pm.response.json();}catch(e){}",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}","","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );","} else {",- " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",- "};",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}","","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(\"- use {{client_secret}} as collection variable for value\",jsonData.client_secret);",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );","} else {",- " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",- "};",- "",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", function() {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- "})};",+ " pm.test(",+ " \"[POST]::/payments/: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;",+ "// Validate the connector",+ "pm.test(\"[POST]::/payments - connector\", function () {",+ " pm.expect(jsonData.connector).to.eql(\"archipel\");","});","",- "// 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\"",+ "if (jsonData?.amount) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '500'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(500);",+ " },",+ " );",+ "}","",- "// Response body should have \"payment_method_data\"",- "pm.test(\"[POST]::/payments - Content check if 'payment_method_data' exists\", function() {",- " pm.expect((typeof jsonData.payment_method_data !== \"undefined\")).to.be.true;",- "});",+ "// Response body should have value \"6000\" for \"amount_received\"",+ "if (jsonData?.amount_received) {",+ " pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '500'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(500);",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"6540\" for \"amount_capturable\"",+ "if (jsonData?.amount) {",+ " pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches '0'\",",+ " function () {",+ " pm.expect(jsonData.amount_capturable).to.eql(0);",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -7823,36 +7960,37 @@}],"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\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"setup_future_usage\":\"off_session\",\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },"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": []},@@ -7961,7 +8099,7 @@"response": []},{- "name": "Recurring Payments - Confirm",+ "name": "Save card payments - Create","event": [{"listen": "test",@@ -8011,21 +8149,143 @@" 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\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"customer_id\":\"{{customer_id}}\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments"+ ]+ },+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ },+ "response": []+ },+ {+ "name": "Save card payments - Confirm",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "","// Response body should have value \"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\");",- "})};",+ " 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;",- "});","",- "// 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 \"archipel\" for \"connector\"",+ "if (jsonData?.connector) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'archipel'\",",+ " function () {",+ " pm.expect(jsonData.connector).to.eql(\"archipel\");",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -8038,7 +8298,7 @@"apikey": [{"key": "value",- "value": "{{api_key}}",+ "value": "{{publishable_key}}","type": "string"},{@@ -8062,12 +8322,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "publishable_key",- "value": "{{publishable_key}}",- "type": "text",- "disabled": true}],"body": {@@ -8077,7 +8331,7 @@"language": "json"}},- "raw": "{\"customer_id\":\"{{customer_id}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\"}"+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\",\"card_cvc\":\"7373\"}"},"url": {"raw": "{{baseUrl}}/payments/:id/confirm",@@ -8092,128 +8346,29 @@"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"},"response": []- }- ]- },- {- "name": "Scenario7-Save card flow",- "item": [+ },{- "name": "Payments - Create",+ "name": "Save card payments - Retrieve","event": [{- "listen": "test",+ "listen": "prerequest","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",- "});",- "",- "// Validate if response has JSON Body ",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {jsonData = pm.response.json();}catch(e){}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",- "};",- "",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(\"- use {{mandate_id}} as collection variable for value\",jsonData.mandate_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.');",- "};",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(\"- use {{client_secret}} as collection variable for value\",jsonData.client_secret);",- "} else {",- " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",- "};",- "",- "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\");",- " },",- " );",- "}"+ "setTimeout(function(){",+ " console.log(\"Sleeping for 3 seconds before next request.\");",+ "}, 3000);"],"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\":500,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"customer_id\":\"{{customer_id}}\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"authentication_type\":\"no_three_ds\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"online\",\"accepted_at\":\"2022-09-10T10:11:12Z\",\"online\":{\"ip_address\":\"123.32.25.123\",\"user_agent\":\"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"5185570141917102\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John 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\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },- "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": {@@ -8305,7 +8460,7 @@" );","}","",- "// Response body should have value \"6000\" for \"amount_received\"",+ "// 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'\",",@@ -8315,7 +8470,7 @@" );","}","",- "// Response body should have value \"6540\" for \"amount_capturable\"",+ "// 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 '0'\",",@@ -8364,113 +8519,15 @@"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"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "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": "Scenario8a-Incremental authorization",+ "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",+ "item": [{- "name": "Save card payments - Create",+ "name": "Payments - Create","event": [{"listen": "test",@@ -8491,10 +8548,19 @@" pm.response.to.have.jsonBody();","});","",+ "","// Set response object as internal variable","let jsonData = {};","try {jsonData = pm.response.json();}catch(e){}","",+ "// Response body should have value \"requires_capture\" for \"status\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " },",+ ");",+ "","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {"," pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",@@ -8503,28 +8569,12 @@" console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');","};","",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(\"- use {{mandate_id}} as collection variable for value\",jsonData.mandate_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.');",- "};",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);"," console.log(\"- use {{client_secret}} as collection variable for value\",jsonData.client_secret);","} else {"," console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",- "};",- "",- "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"@@ -8533,16 +8583,7 @@],"request": {"method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],+ "header": [],"body": {"mode": "raw","options": {@@ -8550,7 +8591,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"amount_to_capture\":500,\"customer_id\":\"{{customer_id}}\",\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"phone_country_code\":\"+91\",\"description\":\"[Archipel][Connector][Scenario8a] - Create payment with incremental authorization\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"}}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -8560,141 +8601,69 @@"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",+ "name": "Payments - Incremental Authorization","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\","," );"," },",");",- "","// 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();","});","",- "// 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.\",",- " );",- "}",+ "var jsonData = pm.response.json();","",- "// 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.test(\"[POST]::/payments:id/incremental_authorizations - Content check have at least one incremental_authorizations \", function () {",+ " // Check if the 'amount' in the response matches the expected value",+ " pm.expect(jsonData.incremental_authorizations.length).greaterThan(0);",+ "});","",- "// 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.\",",- " );",- "}",+ "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'amount' matches '1001'\", function () {",+ " // Check if the 'amount' in the response matches the expected value",+ " pm.expect(jsonData.incremental_authorizations[0].amount).to.eql(1001);",+ "});","",- "// 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\");",- " },",- " );",- "}",+ "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'previously_authorized_amount' matches '500'\", function () {",+ " // Check if the 'amount' in the response matches the expected value",+ " pm.expect(jsonData.incremental_authorizations[0].previously_authorized_amount).to.eql(500);",+ "});","",+ "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();","",- "// Response body should have value \"archipel\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'archipel'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"archipel\");",- " },",- " );",- "}",- ""+ " // 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": {- "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"- }- ],+ "header": [],"body": {"mode": "raw","options": {@@ -8702,154 +8671,109 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\",\"card_cvc\":\"7373\"}"+ "raw": "{\"amount\":1001}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/{{payment_id}}/incremental_authorization","host": ["{{baseUrl}}"],"path": ["payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "{{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": []},{- "name": "Save card payments - Retrieve",+ "name": "Payments - Capture","event": [- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "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.response.to.have.jsonBody();",+ "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) {}",+ " 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,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",+ " 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'\",",+ "// Response body should have value \"succeeded\" for \"status\"",+ "",+ "pm.test(",+ " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },",- " );",- "}",+ ");","",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"archipel\");",- "});","",- "// Response body should have value \"500\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '500'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(500);",- " },",- " );",- "}",+ "// Response body should have value \"1001\" for \"amount\"","",- "// 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'\",",+ "pm.test(",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '1001'\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(500);",+ " pm.expect(jsonData.amount).to.eql(1001);"," },",- " );",- "}",+ ");","",- "// 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 '0'\",",+ "// Response body should have value \"1001\" for \"amount_received\"",+ "",+ "pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '1001'\","," function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",+ " pm.expect(jsonData.amount_received).to.eql(1001);"," },",- " );",- "}",+ ");",+ "",""],"type": "text/javascript"@@ -8857,45 +8781,43 @@}],"request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],+ "method": "POST",+ "header": [],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"amount_to_capture\":1001}"+ },"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": [{"key": "id","value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "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": "Scenario8a-Incremental authorization",- "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",+ "name": "Scenario8b-Incremental authorization with partial capture",+ "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","item": [{"name": "Payments - Create",@@ -8962,7 +8884,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"phone_country_code\":\"+91\",\"description\":\"[Archipel][Connector][Scenario8a] - Create payment with incremental authorization\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"}}}"+ "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"phone_country_code\":\"+91\",\"description\":\"[Archipel][Connector][Scenario8b] - Create payment with incremental authorization and partial capture\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"}}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -9067,84 +8989,85 @@"exec": ["// Validate status 2xx","pm.test(\"[POST]::/payments/:id/capture - 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/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",+ " \"[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.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};","try {",- " jsonData = pm.response.json();",+ " 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\"",- "",- "pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\",",+ "// Response body should have value \"partially_captured\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"partially_captured\");"," },",- ");",- "",+ " );",+ "}","","// Response body should have value \"1001\" for \"amount\"",- "",- "pm.test(",+ "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);",+ " pm.expect(jsonData.amount).to.eql(1001);"," },",- ");",- "",- "// Response body should have value \"1001\" for \"amount_received\"",+ " );",+ "}","",- "pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '1001'\",",+ "// Response body should have value \"600\" for \"amount_received\"",+ "if (jsonData?.amount_received) {",+ " pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '600'\","," function () {",- " pm.expect(jsonData.amount_received).to.eql(1001);",+ " pm.expect(jsonData.amount_received).to.eql(600);"," },",- ");",- "",+ " );",+ "}",""],"type": "text/javascript"@@ -9161,7 +9084,7 @@"language": "json"}},- "raw": "{\"amount_to_capture\":1001}"+ "raw": "{\"amount_to_capture\":600}"},"url": {"raw": "{{baseUrl}}/payments/:id/capture",@@ -9177,7 +9100,7 @@{"key": "id","value": "{{payment_id}}",- "description": "To capture the funds for an uncaptured payment"+ "description": "(Required) unique payment id"}]}@@ -9187,8 +9110,7 @@]},{- "name": "Scenario8b-Incremental authorization with partial capture",- "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",+ "name": "Scenario9a-Refund full payment","item": [{"name": "Payments - Create",@@ -9197,49 +9119,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){}",- "",- "// Response body should have value \"requires_capture\" for \"status\"",- "pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- ");",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}","","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );","} else {",- " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",- "};",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// 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 \"500\" for \"amount\"",+ "pm.test(\"[POST]::/payments - Content check if value for 'amount' matches '500'\",",+ "function () {",+ " pm.expect(jsonData.amount).to.eql(500);",+ "});","",- "// 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 \"EUR\" for \"currency\"",+ "pm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'EUR'\",",+ "function () {",+ " pm.expect(jsonData.currency).to.eql(\"EUR\");",+ "});",+ ""],"type": "text/javascript"}@@ -9247,7 +9197,16 @@],"request": {"method": "POST",- "header": [],+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],"body": {"mode": "raw","options": {@@ -9255,7 +9214,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"phone_country_code\":\"+91\",\"description\":\"[Archipel][Connector][Scenario8b] - Create payment with incremental authorization and partial capture\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"}}}"+ "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"},"url": {"raw": "{{baseUrl}}/payments",@@ -9265,61 +9224,70 @@"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 - Incremental Authorization",+ "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\",",+ " );","});","",- "var jsonData = pm.response.json();",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}","",- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check have at least one incremental_authorizations \", function () {",- " // Check if the 'amount' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations.length).greaterThan(0);",- "});",+ "// 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.\",",+ " );",+ "}","",- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'amount' matches '1001'\", function () {",- " // Check if the 'amount' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].amount).to.eql(1001);",+ "// Response body should have value \"failed\" for \"status\" and error message should contain \"[/refund/{{connector_transaction_id}}] Cannot find any remitted transaction with given order id\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'failed'\", ",+ "function () {",+ " pm.expect(jsonData.status).to.eql(\"failed\");",+ " pm.expect(jsonData.error_message).to.include(",+ " \"[/refund/\"",+ " ) + pm.collectionVariables.get(\"connector_transaction_id\") + \"] Cannot find any remitted transaction with given order id\";","});","",- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'previously_authorized_amount' matches '500'\", function () {",- " // Check if the 'amount' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].previously_authorized_amount).to.eql(500);",+ "// Response body should have value \"500\" for \"amount\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '500'\",",+ "function () {",+ " pm.expect(jsonData.amount).to.eql(500);","});","",- "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\");",- "});"+ "// Response body should have \"EUR\" for \"currency\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'EUR'\",",+ "function () {",+ " pm.expect(jsonData.currency).to.eql(\"EUR\");",+ "});",+ ""],"type": "text/javascript"}@@ -9327,7 +9295,16 @@],"request": {"method": "POST",- "header": [],+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],"body": {"mode": "raw","options": {@@ -9335,110 +9312,79 @@"language": "json"}},- "raw": "{\"amount\":1001}"+ "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}}/payments/{{payment_id}}/incremental_authorization",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments",- "{{payment_id}}",- "incremental_authorization"+ "refunds"]- }+ },+ "description": "To create a refund against an already processed payment"},"response": []},{- "name": "Payments - Capture",+ "name": "Refunds - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",+ "pm.test(\"[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","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.\",",- " );",- "}",+ "} 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);",+ "// 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 \"partially_captured\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " },",- " );",- "}",+ "// Response body should have value \"failed\" for \"status\" and error message should contain \"[/refund/{{connector_transaction_id}}] Cannot find any remitted transaction with given order id\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'failed'\", ",+ "function () {",+ " pm.expect(jsonData.status).to.eql(\"failed\");",+ " pm.expect(jsonData.error_message).to.include(",+ " \"[/refund/\"",+ " ) + pm.collectionVariables.get(\"connector_transaction_id\") + \"] Cannot find any remitted transaction with given order id\";",+ "});","",- "// 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\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '500'\",",+ "function () {",+ " pm.expect(jsonData.amount).to.eql(500);",+ "});","",- "// Response body should have value \"600\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '600'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(600);",- " },",- " );",- "}",+ "// Response body should have \"EUR\" for \"currency\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'EUR'\",",+ "function () {",+ " pm.expect(jsonData.currency).to.eql(\"EUR\");",+ "});",""],"type": "text/javascript"@@ -9446,42 +9392,38 @@}],"request": {- "method": "POST",- "header": [],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":600}"- },+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],"url": {- "raw": "{{baseUrl}}/payments/:id/capture",+ "raw": "{{baseUrl}}/refunds/:id","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "capture"+ "refunds",+ ":id"],"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 Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []}]},{- "name": "Scenario9a-Refund full payment",+ "name": "Scenario9b-Refund partial payment","item": [{"name": "Payments - Create",@@ -9647,10 +9589,10 @@" ) + pm.collectionVariables.get(\"connector_transaction_id\") + \"] Cannot find any remitted transaction with given order id\";","});","",- "// Response body should have value \"500\" for \"amount\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '500'\",",+ "// Response body should have value \"200\" for \"amount\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '200'\",","function () {",- " pm.expect(jsonData.amount).to.eql(500);",+ " pm.expect(jsonData.amount).to.eql(200);","});","","// Response body should have \"EUR\" for \"currency\"",@@ -9683,7 +9625,7 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":500,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":200,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {"raw": "{{baseUrl}}/refunds",@@ -9745,10 +9687,10 @@" ) + pm.collectionVariables.get(\"connector_transaction_id\") + \"] Cannot find any remitted transaction with given order id\";","});","",- "// Response body should have value \"500\" for \"amount\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '500'\",",+ "// Response body should have value \"200\" for \"amount\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '200'\",","function () {",- " pm.expect(jsonData.amount).to.eql(500);",+ " pm.expect(jsonData.amount).to.eql(200);","});","","// Response body should have \"EUR\" for \"currency\"",@@ -9794,7 +9736,7 @@]},{- "name": "Scenario9b-Refund partial payment",+ "name": "Scenario9c-Refund full incremented payment","item": [{"name": "Payments - Create",@@ -9803,77 +9745,129 @@"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){}",+ "",+ "// Response body should have value \"requires_capture\" for \"status\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " },",+ ");","","// 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.');",+ "};"+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"phone_country_code\":\"+91\",\"description\":\"[Archipel][Connector][Scenario8a] - Create payment with incremental authorization\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"}}}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments"+ ]+ }+ },+ "response": []+ },+ {+ "name": "Payments - Incremental Authorization",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": ["",- "// 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\");",- " },",- " );",- "}",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});","",- "// Response body should have value \"500\" for \"amount\"",- "pm.test(\"[POST]::/payments - Content check if value for 'amount' matches '500'\",",- "function () {",- " pm.expect(jsonData.amount).to.eql(500);",+ "// 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();","});","",- "// Response body should have \"EUR\" for \"currency\"",- "pm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'EUR'\",",- "function () {",- " pm.expect(jsonData.currency).to.eql(\"EUR\");",+ "var jsonData = pm.response.json();",+ "",+ "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check have at least one incremental_authorizations \", function () {",+ " // Check if the 'amount' in the response matches the expected value",+ " pm.expect(jsonData.incremental_authorizations.length).greaterThan(0);","});",- ""+ "",+ "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'amount' matches '1001'\", function () {",+ " // 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 'previously_authorized_amount' matches '500'\", function () {",+ " // Check if the 'amount' in the response matches the expected value",+ " pm.expect(jsonData.incremental_authorizations[0].previously_authorized_amount).to.eql(500);",+ "});",+ "",+ "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"}@@ -9881,16 +9875,7 @@],"request": {"method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],+ "header": [],"body": {"mode": "raw","options": {@@ -9898,79 +9883,109 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"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 Doe\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount\":1001}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/{{payment_id}}/incremental_authorization","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ "{{payment_id}}",+ "incremental_authorization"]- },- "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.response.to.be.success;",+ "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","let jsonData = {};","try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ " 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 \"failed\" for \"status\" and error message should contain \"[/refund/{{connector_transaction_id}}] Cannot find any remitted transaction with given order id\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'failed'\", ",- "function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " pm.expect(jsonData.error_message).to.include(",- " \"[/refund/\"",- " ) + pm.collectionVariables.get(\"connector_transaction_id\") + \"] Cannot find any remitted transaction with given order id\";",- "});",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{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\"",+ "",+ "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\"",+ "",+ "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 \"200\" for \"amount\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '200'\",",- "function () {",- " pm.expect(jsonData.amount).to.eql(200);",- "});",+ "// Response body should have value \"1001\" for \"amount_received\"",+ "",+ "pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '1001'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(1001);",+ " },",+ ");","",- "// Response body should have \"EUR\" for \"currency\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'EUR'\",",- "function () {",- " pm.expect(jsonData.currency).to.eql(\"EUR\");",- "});",""],"type": "text/javascript"@@ -9979,16 +9994,7 @@],"request": {"method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],+ "header": [],"body": {"mode": "raw","options": {@@ -9996,23 +10002,31 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":200,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"amount_to_capture\":1001}"},"url": {- "raw": "{{baseUrl}}/refunds",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": [- "refunds"+ "payments",+ ":id",+ "capture"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "To capture the funds for an uncaptured payment"+ }]- },- "description": "To create a refund against an already processed payment"+ }},"response": []},{- "name": "Refunds - Retrieve",+ "name": "Refunds - Create","event": [{"listen": "test",@@ -10058,10 +10072,10 @@" ) + pm.collectionVariables.get(\"connector_transaction_id\") + \"] Cannot find any remitted transaction with given order id\";","});","",- "// Response body should have value \"200\" for \"amount\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '200'\",",+ "// Response body should have value \"1001\" for \"amount\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '1001'\",","function () {",- " pm.expect(jsonData.amount).to.eql(200);",+ " pm.expect(jsonData.amount).to.eql(1001);","});","","// Response body should have \"EUR\" for \"currency\"",@@ -10076,38 +10090,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": "{\"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}}/refunds/:id",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }+ "refunds"]},- "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 create a refund against an already processed payment"},"response": []}]},{- "name": "Scenario9c-Refund full incremented payment",+ "name": "Scenario10-Create 3DS payment without external 3ds authentication","item": [{"name": "Payments - Create",@@ -10116,129 +10135,74 @@"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){}",- "",- "// Response body should have value \"requires_capture\" for \"status\"",- "pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- ");",+ "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"}- }- ],- "request": {- "method": "POST",- "header": [],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"manual\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"phone_country_code\":\"+91\",\"description\":\"[Archipel][Connector][Scenario8a] - Create payment with incremental authorization\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\"}},\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"}}}"},- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- }- },- "response": []- },- {- "name": "Payments - Incremental Authorization",- "event": [{- "listen": "test",+ "listen": "prerequest","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();",- "});",- "",- "var jsonData = pm.response.json();",- "",- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check have at least one incremental_authorizations \", function () {",- " // Check if the 'amount' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations.length).greaterThan(0);",- "});",- "",- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'amount' matches '1001'\", function () {",- " // 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 'previously_authorized_amount' matches '500'\", function () {",- " // Check if the 'amount' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].previously_authorized_amount).to.eql(500);",- "});",- "",- "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"}@@ -10246,7 +10210,16 @@],"request": {"method": "POST",- "header": [],+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],"body": {"mode": "raw","options": {@@ -10254,109 +10227,96 @@"language": "json"}},- "raw": "{\"amount\":1001}"+ "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"authentication_type\":\"three_ds\",\"request_external_three_ds_authentication\":false,\"profile_id\":\"{{profile_id}}\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"8056594427\",\"phone_country_code\":\"+91\",\"description\":\"{{$randomLoremSentence}}\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"FRA\",\"zip\":\"92200\",\"country\":\"FR\"},\"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\"}}}"},"url": {- "raw": "{{baseUrl}}/payments/{{payment_id}}/incremental_authorization",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- "{{payment_id}}",- "incremental_authorization"+ "payments"]- }+ },+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"},"response": []},{- "name": "Payments - Capture",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "exec": [+ "// Validate status 400",+ "pm.test(\"[POST]::/payments/:id/confirm - Status code is 400\", function () {",+ " pm.response.to.have.status(400);","});","","// 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\",",- " );",- " },",+ " \"[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/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "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.\",",- " );",- "}",+ " jsonData = pm.response.json();",+ "} catch (e) {}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Validate if response has error body",+ "pm.test(\"[POST]::/payments/:id/confirm - Response has error body\", function () {",+ " pm.expect(jsonData).to.have.property(\"error\");",+ "});","",+ "// Validate if error type is \"invalid_request\"","pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",+ " \"[POST]::/payments/:id/confirm - Error type is 'invalid_request'\",",+ " function () {",+ " pm.expect(jsonData.error).to.have.property(\"type\", \"invalid_request\");",+ " },",");","",- "",- "// Response body should have value \"1001\" for \"amount\"",- "",+ "// Validate if error message is \"Payment method type not supported\"","pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '1001'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1001);",- " },",+ " \"[POST]::/payments/:id/confirm - Error message is 'Payment method type not supported'\",",+ " function () {",+ " pm.expect(jsonData.error).to.have.property(",+ " \"message\",",+ " \"Payment method type not supported\",",+ " );",+ " },",");","",- "// Response body should have value \"1001\" for \"amount_received\"",- "",+ "// Validate if error reason is \"Selected 3DS authentication method is not supported by archipel\"","pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '1001'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(1001);",- " },",- ");",- "",+ " \"[POST]::/payments/:id/confirm - Error reason is 'Selected 3DS authentication method is not supported by archipel'\",",+ " function () {",+ " pm.expect(jsonData.error).to.have.property(",+ " \"reason\",",+ " \"Selected 3DS authentication method is not supported by archipel\",",+ " );",+ " },",+ ");"+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -10364,8 +10324,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": {@@ -10373,87 +10362,97 @@"language": "json"}},- "raw": "{\"amount_to_capture\":1001}"+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"4242424242424242\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"},"url": {- "raw": "{{baseUrl}}/payments/:id/capture",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": ["payments",":id",- "capture"+ "confirm"],"variable": [{"key": "id","value": "{{payment_id}}",- "description": "To capture the funds for an uncaptured payment"+ "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": "Refunds - Create",+ "name": "Payments - Retrieve after confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\","," );","});","",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "","// Set response object as internal variable","let jsonData = {};","try {"," jsonData = pm.response.json();","} catch (e) {}","",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",- " 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 \"requires_payment_method\" for \"status\"",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " },",+ ");","",- "// Response body should have value \"failed\" for \"status\" and error message should contain \"[/refund/{{connector_transaction_id}}] Cannot find any remitted transaction with given order id\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'failed'\", ",- "function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " pm.expect(jsonData.error_message).to.include(",- " \"[/refund/\"",- " ) + pm.collectionVariables.get(\"connector_transaction_id\") + \"] Cannot find any remitted transaction with given order id\";",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'amount' equal 500\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(500);",+ " },",+ ");","",- "// Response body should have value \"1001\" for \"amount\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '1001'\",",- "function () {",- " pm.expect(jsonData.amount).to.eql(1001);",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'net_amount' equal 500\",",+ " function () {",+ " pm.expect(jsonData.net_amount).to.eql(500);",+ " },",+ ");","",- "// Response body should have \"EUR\" for \"currency\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'EUR'\",",- "function () {",- " pm.expect(jsonData.currency).to.eql(\"EUR\");",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'amount_capturable' equal 0\",",+ " function () {",+ " pm.expect(jsonData.amount_capturable).to.eql(0);",+ " },",+ ");",+ "",+ "// 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"@@ -10461,36 +10460,37 @@}],"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\":1001,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },"url": {- "raw": "{{baseUrl}}/refunds",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "refunds"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "description": "To create a refund against an already processed payment"+ "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []}