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-actions6419ad85fbc0
diff --git a/postman/collection-json/archipel.postman_collection.json b/postman/collection-json/archipel.postman_collection.jsonindex 1bcd51175d..a70b6a5549 100644--- a/postman/collection-json/archipel.postman_collection.json+++ b/postman/collection-json/archipel.postman_collection.json@@ -280,7 +280,7 @@"language": "json"}},- "raw": "{\"merchant_id\":\"flowbird\",\"organization_id\":\"{{organization_id}}\",\"merchant_name\":\"Flowbird\",\"merchant_details\":{\"primary_contact_person\":\"Primary Contact Person\",\"primary_email\":\"[email protected]\",\"primary_phone\":\"Primary Phone Number\",\"secondary_contact_person\":\"Flowbird contact\",\"secondary_email\":\"[email protected]\",\"secondary_phone\":\"+33 (0) 1 58 09 81 10\",\"website\":\"https://www.flowbird.com/\",\"about_business\":\"Effortless Parking, Charging, Payments and Movement, From City to City\",\"address\":{\"line1\":\"2 ter rue du château\",\"line2\":\"\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"}},\"sub_merchants_enabled\":false,\"metadata\":{\"compatible_connector\":\"archipel\"}}"+ "raw": "{\"merchant_id\":\"postman_merchant_GHAction_{{$guid}}\",\"organization_id\":\"{{organization_id}}\",\"merchant_name\":\"Flowbird\",\"merchant_details\":{\"primary_contact_person\":\"Primary Contact Person\",\"primary_email\":\"[email protected]\",\"primary_phone\":\"Primary Phone Number\",\"secondary_contact_person\":\"Flowbird contact\",\"secondary_email\":\"[email protected]\",\"secondary_phone\":\"+33 (0) 1 58 09 81 10\",\"website\":\"https://www.flowbird.com/\",\"about_business\":\"Effortless Parking, Charging, Payments and Movement, From City to City\",\"address\":{\"line1\":\"2 ter rue du château\",\"line2\":\"\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"}},\"sub_merchants_enabled\":false,\"metadata\":{\"compatible_connector\":\"archipel\"}}"},"url": {"raw": "{{baseUrl}}/accounts",@@ -564,6 +564,7 @@"// Set response object as internal variable","let jsonData = pm.response.json();","",+ "// Validate if connector_type is payment_processor","pm.test("," \"[POST]::/account/:account_id/connectors - Validate connector_type\","," function () {",@@ -573,6 +574,7 @@" },",");","",+ "// Validate if connector_name is archipel","pm.test("," \"[POST]::/account/:account_id/connectors - Validate connector_name\","," function () {",@@ -582,6 +584,7 @@" },",");","",+ "// Validate if connector_account_details are not empty","pm.test("," \"[POST]::/account/:account_id/connectors - Validate merchant_connector_id\","," function () {",@@ -606,15 +609,17 @@" },",");","",+ "// Validate if auth_type is HeaderKey","pm.test(",- " \"[POST]::/account/:account_id/connectors - Validate auth_type is NoKey\",",+ " \"[POST]::/account/:account_id/connectors - Validate auth_type is HeaderKey\","," function () {"," pm.expect(jsonData.connector_account_details.auth_type).to.equal(",- " \"NoKey\"",+ " \"HeaderKey\""," );"," },",");","",+ "// Validate if metadata contains tenant_id","pm.test("," \"[POST]::/account/:account_id/connectors - Validate metadata contains tenant_id\","," function () {",@@ -622,21 +627,23 @@" },",");","",+ "// Validate if test_mode is true","pm.test("," \"[POST]::/account/:account_id/connectors - Validate is not test_mode\","," function () {",- " pm.expect(jsonData.test_mode).to.be.false;",+ " pm.expect(jsonData.test_mode).to.be.true;"," },",");","",- "",+ "// Validate if disabled is false","pm.test("," \"[POST]::/account/:account_id/connectors - Validate is not disabled\","," function () {",- " pm.expect(jsonData.test_mode).to.be.false;",+ " pm.expect(jsonData.disabled).to.be.false;"," },",");","",+ "// Validate if status is active","pm.test("," \"[POST]::/account/:account_id/connectors - Validate have active status\","," function () {",@@ -691,7 +698,7 @@"language": "json"}},- "raw": "{\"connector_type\":\"payment_processor\",\"connector_name\":\"archipel\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"connector_api_key\"},\"metadata\":{\"tenant_id\":\"{{archipel_tenant_id}}\",\"platform_url\":\"{{archipel_platform_url}}\",\"apple_pay_combined\":{\"manual\":{\"session_token_data\":{\"initiative\":\"web\",\"certificate\":\"\",\"display_name\":\"Flowbird\",\"certificate_keys\":\"\",\"initiative_context\":\"\",\"merchant_identifier\":\"\",\"merchant_business_country\":\"\",\"payment_processing_details_at\":\"Hyperswitch\",\"payment_processing_certificate\":\"\",\"payment_processing_certificate_key\":\"\"},\"payment_request_data\":{\"label\":\"Flowbird\",\"supported_networks\":[\"visa\",\"masterCard\",\"amex\",\"discover\"],\"merchant_capabilities\":[\"supports3DS\"]}}}},\"profile_id\":\"{{profile_id}}\",\"test_mode\":false,\"disabled\":false,\"payment_methods_enabled\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"payment_experience\":null,\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"debit\",\"payment_experience\":null,\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"apple_pay\",\"payment_experience\":null,\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":false,\"installment_payment_enabled\":true}]}]}"+ "raw": "{\"connector_type\":\"payment_processor\",\"connector_name\":\"archipel\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"{{connector_api_key}}\"},\"metadata\":{\"tenant_id\":\"{{archipel_tenant_id}}\",\"platform_url\":\"{{archipel_platform_url}}\",\"apple_pay_combined\":{\"manual\":{\"session_token_data\":{\"initiative\":\"web\",\"certificate\":\"\",\"display_name\":\"Flowbird\",\"certificate_keys\":\"\",\"initiative_context\":\"\",\"merchant_identifier\":\"\",\"merchant_business_country\":\"\",\"payment_processing_details_at\":\"Hyperswitch\",\"payment_processing_certificate\":\"\",\"payment_processing_certificate_key\":\"\"},\"payment_request_data\":{\"label\":\"Flowbird\",\"supported_networks\":[\"visa\",\"masterCard\",\"amex\",\"discover\"],\"merchant_capabilities\":[\"supports3DS\"]}}}},\"profile_id\":\"{{profile_id}}\",\"test_mode\":true,\"disabled\":false,\"payment_methods_enabled\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"payment_experience\":null,\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"debit\",\"payment_experience\":null,\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"apple_pay\",\"payment_experience\":null,\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":false,\"installment_payment_enabled\":true}]}]}"},"url": {"raw": "{{baseUrl}}/account/:account_id/connectors",@@ -716,38 +723,96 @@"response": []},{- "name": "Customer - Create",+ "name": "3DS Authenticator - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/customers - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",+ "// Validate status 2xx",+ "pm.test(",+ " \"[POST]::/account/:account_id/connectors - Status code is 2xx\",",+ " function () {",+ " pm.response.to.have.status(200);",+ " },",+ ");","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/customers - 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]::/customers - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",+ "pm.test(",+ " \"[POST]::/account/:account_id/connectors - 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){}",+ "let jsonData = pm.response.json();","",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.payment_id is undefined.');",- "};"+ "// Validate if connector_type is authentication_processor",+ "pm.test(",+ " \"[POST]::/account/:account_id/connectors - Validate connector_type\",",+ " function () {",+ " pm.expect(jsonData.connector_type).to.equal(",+ " \"authentication_processor\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if connector_name is netcetera",+ "pm.test(",+ " \"[POST]::/account/:account_id/connectors - Validate connector_name\",",+ " function () {",+ " pm.expect(jsonData.connector_name).to.equal(",+ " \"netcetera\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if auth_type is CertificateAuth",+ "pm.test(",+ " \"[POST]::/account/:account_id/connectors - Validate auth_type is CertificateAuth\",",+ " function () {",+ " pm.expect(jsonData.connector_account_details.auth_type).to.equal(",+ " \"CertificateAuth\"",+ " );",+ " },",+ ");",+ "",+ "// Validate if metadata contains merchant_configuration_id",+ "pm.test(",+ " \"[POST]::/account/:account_id/connectors - Validate metadata contains merchant_configuration_id\",",+ " function () {",+ " pm.expect(jsonData.metadata.merchant_configuration_id).to.not.be.null;",+ " },",+ ");",+ "",+ "// Validate if test_mode is true",+ "pm.test(",+ " \"[POST]::/account/:account_id/connectors - Validate is not test_mode\",",+ " function () {",+ " pm.expect(jsonData.test_mode).to.be.true;",+ " },",+ ");",+ "",+ "// Validate if disabled is false",+ "pm.test(",+ " \"[POST]::/account/:account_id/connectors - Validate is not disabled\",",+ " function () {",+ " pm.expect(jsonData.disabled).to.be.false;",+ " },",+ ");",+ "",+ "// Validate if status is active",+ "pm.test(",+ " \"[POST]::/account/:account_id/connectors - Validate have active status\",",+ " function () {",+ " pm.expect(jsonData.status).to.equal(",+ " \"active\"",+ " );",+ " },",+ ");"],"type": "text/javascript"}@@ -783,6 +848,14 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "x-merchant-id",+ "value": "{{merchant_id}}"+ },+ {+ "key": "x-profile-id",+ "value": "{{profile_id}}"}],"body": {@@ -792,44 +865,54 @@"language": "json"}},- "raw": "{\"name\":\"User Test\",\"email\":\"[email protected]\",\"phone\":\"381545600\",\"phone_country_code\":\"+33\",\"description\":\"Archipel connector test user\",\"address\":{\"line1\":\"Parc La Fayette\",\"line2\":\"6 Rue Isaac Newton\",\"line3\":\"\",\"zip\":\"25000\",\"city\":\"Besancon\",\"state\":\"FRANCE\",\"country\":\"FR\",\"first_name\":\"User\",\"last_name\":\"Test\"},\"metadata\":{}}"+ "raw": "{\"connector_type\":\"authentication_processor\",\"connector_name\":\"netcetera\",\"connector_account_details\":{\"auth_type\":\"CertificateAuth\",\"certificate\":\"{{netcetera_certificate}}\",\"private_key\":\"{{netcetera_private_key}}\"},\"metadata\":{\"merchant_configuration_id\":\"{{netcetera_merchant_configuration_id}}\",\"endpoint_prefix\":\"flowbird\",\"pull_mechanism_for_external_3ds_enabled\":false},\"profile_id\":\"{{profile_id}}\",\"test_mode\":true,\"disabled\":false,\"status\":\"active\",\"additional_merchant_data\":null}"},"url": {- "raw": "{{baseUrl}}/customers",+ "raw": "{{baseUrl}}/account/:account_id/connectors","host": ["{{baseUrl}}"],"path": [- "customers"+ "account",+ ":account_id",+ "connectors"+ ],+ "variable": [+ {+ "key": "account_id",+ "value": "{{merchant_id}}",+ "description": "(Required) The unique identifier for the merchant account"+ }]},- "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": "Create a new 3DS Authenticator for the merchant account. This endpoint allows you to set up a 3DS Authenticator that can be used for processing 3D Secure transactions."},"response": []},{- "name": "Payments - Create",+ "name": "3DS Authenticator - Configure","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Status code is 2xx\",",+ " function () {",+ " pm.response.to.be.success;",+ " },",+ ");","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - 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 = {};",@@ -837,51 +920,82 @@" 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 correct merchant_id",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate merchant_id\",",+ " function () {",+ " pm.expect(jsonData.merchant_id).to.eql(",+ " pm.collectionVariables.get(\"merchant_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.\",",- " );",- "}",+ "// Validate if response has correct profile_id",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate profile_id\",",+ " function () {",+ " pm.expect(jsonData.profile_id).to.eql(",+ " pm.collectionVariables.get(\"profile_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.\",",- " );",- "}",- ""+ "// Validate if authentication_connector_details is present",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate authentication_connector_details is present\",",+ " function () {",+ " pm.expect(jsonData.authentication_connector_details).to.be.an(\"object\");",+ " }",+ ");",+ "",+ "// Validate if authentication_connector_details has netcetera as authentication_connectors",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate authentication_connector_details has netcetera\",",+ " function () {",+ " pm.expect(jsonData.authentication_connector_details.authentication_connectors[0]).to.eql(",+ " \"netcetera\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if authentication_connector_details has three_ds_requestor_url and three_ds_requestor_app_url",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate authentication_connector_details has three_ds_requestor_url and three_ds_requestor_app_url\",",+ " function () {",+ " pm.expect(jsonData.authentication_connector_details).to.have.property(",+ " \"three_ds_requestor_url\",",+ " );",+ " pm.expect(jsonData.authentication_connector_details).to.have.property(",+ " \"three_ds_requestor_app_url\",",+ " );",+ " },",+ ");"],"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": [{@@ -891,6 +1005,14 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "x-merchant-id",+ "value": "{{merchant_id}}"+ },+ {+ "key": "x-profile-id",+ "value": "{{profile_id}}"}],"body": {@@ -900,39 +1022,59 @@"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": "{\"return_url\":\"https://abc.com/\",\"collect_shipping_details_from_wallet_connector\":false,\"always_collect_shipping_details_from_wallet_connector\":false,\"collect_billing_details_from_wallet_connector\":false,\"always_collect_billing_details_from_wallet_connector\":false,\"is_auto_retries_enabled\":false,\"is_connector_agnostic_mit_enabled\":false,\"force_3ds_challenge\":false,\"is_debit_routing_enabled\":false,\"webhook_details\":{\"webhook_version\":null,\"webhook_username\":null,\"webhook_password\":null,\"webhook_url\":null,\"payment_created_enabled\":null,\"payment_succeeded_enabled\":null,\"payment_failed_enabled\":null},\"authentication_connector_details\":{\"authentication_connectors\":[\"netcetera\"],\"three_ds_requestor_url\":\"{{netcetera_requestor_url}}\",\"three_ds_requestor_app_url\":\"{{netcetera_requestor_app_url}}\"},\"is_click_to_pay_enabled\":false}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/account/:account_id/business_profile/:profile_id","host": ["{{baseUrl}}"],"path": [- "payments"+ "account",+ ":account_id",+ "business_profile",+ ":profile_id"+ ],+ "variable": [+ {+ "key": "account_id",+ "value": "{{merchant_id}}",+ "description": "(Required) The unique identifier for the merchant account"+ },+ {+ "key": "profile_id",+ "value": "{{profile_id}}",+ "description": "(Required) The unique identifier for the business profile"+ }]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ }},"response": []},{- "name": "Payments - Retrieve",+ "name": "Connector Agnostic MIT - Enable","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - 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]::/account/:account_id/business_profile - 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 = {};",@@ -940,11 +1082,267 @@" jsonData = pm.response.json();","} catch (e) {}","",+ "// Validate if response has correct merchant_id",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate merchant_id\",",+ " function () {",+ " pm.expect(jsonData.merchant_id).to.eql(",+ " pm.collectionVariables.get(\"merchant_id\")",+ " );",+ " }",+ ");",+ "",+ "// Validate if response has correct profile_id",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate profile_id\",",+ " function () {",+ " pm.expect(jsonData.profile_id).to.eql(",+ " pm.collectionVariables.get(\"profile_id\")",+ " );",+ " }",+ ");",+ "",+ "// Validate if authentication_connector_details is present",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate authentication_connector_details is present\",",+ " function () {",+ " pm.expect(jsonData.authentication_connector_details).to.be.an(\"object\");",+ " }",+ ");",+ "",+ "// Validate if authentication_connector_details has netcetera as authentication_connectors",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate authentication_connector_details has netcetera\",",+ " function () {",+ " pm.expect(jsonData.authentication_connector_details.authentication_connectors[0]).to.eql(",+ " \"netcetera\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if authentication_connector_details has three_ds_requestor_url and three_ds_requestor_app_url",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate authentication_connector_details has three_ds_requestor_url and three_ds_requestor_app_url\",",+ " function () {",+ " pm.expect(jsonData.authentication_connector_details).to.have.property(",+ " \"three_ds_requestor_url\",",+ " );",+ " pm.expect(jsonData.authentication_connector_details).to.have.property(",+ " \"three_ds_requestor_app_url\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if is_connector_agnostic_mit_enabled true or not",+ "pm.test(",+ " \"[POST]::/account/:account_id/business_profile - Validate is_connector_agnostic_mit_enabled is true\",",+ " function () {",+ " pm.expect(jsonData.is_connector_agnostic_mit_enabled).to.eql(true);",+ " }",+ ");"+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{api_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ },+ {+ "key": "x-merchant-id",+ "value": "{{merchant_id}}"+ },+ {+ "key": "x-profile-id",+ "value": "{{profile_id}}"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"is_connector_agnostic_mit_enabled\":true}"+ },+ "url": {+ "raw": "{{baseUrl}}/account/:account_id/business_profile/:profile_id",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "account",+ ":account_id",+ "business_profile",+ ":profile_id"+ ],+ "variable": [+ {+ "key": "account_id",+ "value": "{{merchant_id}}",+ "description": "(Required) The unique identifier for the merchant account"+ },+ {+ "key": "profile_id",+ "value": "{{profile_id}}",+ "description": "(Required) The unique identifier for the business profile"+ }+ ]+ }+ },+ "response": []+ },+ {+ "name": "Customer - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/customers - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/customers - 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]::/customers - 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.customer_id",+ "if (jsonData?.customer_id) {",+ " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",+ " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.payment_id is undefined.');",+ "};"+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{api_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"name\":\"User Test\",\"email\":\"[email protected]\",\"phone\":\"381545600\",\"phone_country_code\":\"+33\",\"description\":\"Archipel connector test user\",\"address\":{\"line1\":\"Parc La Fayette\",\"line2\":\"6 Rue Isaac Newton\",\"line3\":\"\",\"zip\":\"25000\",\"city\":\"Besancon\",\"state\":\"FRANCE\",\"country\":\"FR\",\"first_name\":\"User\",\"last_name\":\"Test\"},\"metadata\":{}}"+ },+ "url": {+ "raw": "{{baseUrl}}/customers",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "customers"+ ]+ },+ "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 - 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(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ "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);",@@ -990,22 +1388,130 @@}],"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\":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/:id",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],+ "payments"+ ]+ },+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ },+ "response": []+ },+ {+ "name": "Payments - Retrieve",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " 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.\",",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {+ "raw": "{{baseUrl}}/payments/:id",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id"+ ],"variable": [{"key": "id",@@ -1024,7 +1530,7 @@"name": "Happy Cases","item": [{- "name": "Scenario7-Void the payment",+ "name": "Scenario10-Create 3DS payment without external 3ds authentication ","item": [{"name": "Payments - Create",@@ -1082,23 +1588,16 @@" );","}","",- "// 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)",- " },",- ");"+ "// 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"}@@ -1132,7 +1631,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][Scenario7] - Create payment and cancel it\",\"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\":\"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",@@ -1148,20 +1647,20 @@"response": []},{- "name": "Payments - Cancel",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/cancel - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// 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/cancel - Content-Type is application/json\",",+ " \"[POST]::/payments/:id/confirm - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -1170,7 +1669,7 @@");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -1180,41 +1679,48 @@" 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/confirm - Response has error body\", function () {",+ " pm.expect(jsonData).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 error type is \"invalid_request\"",+ "pm.test(",+ " \"[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 \"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 error message is \"Payment method type not supported\"",+ "pm.test(",+ " \"[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\",",+ " );",+ " },",+ ");",+ "",+ "// 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'\",",+ " 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"@@ -1222,6 +1728,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": [{@@ -1240,17 +1766,17 @@"language": "json"}},- "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_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/cancel",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": ["payments",":id",- "cancel"+ "confirm"],"variable": [{@@ -1260,53 +1786,161 @@}]},- "description": "A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []- }- ]- },- {- "name": "Scenario1-Create payment with confirm true",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Retrieve after confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[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();",+ "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) { }",+ " 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 {",+ "// 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\");",+ " },",+ ");",+ "",+ "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);",+ " },",+ ");",+ "",+ "// 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": "Scenario1-Create payment with confirm true",+ "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.\","," );",@@ -3916,66 +4550,86 @@]},{- "name": "Scenario4-Zero auth mandates",+ "name": "Scenario4a-Void a payment","item": [{- "name": "Payments - Create mandate",+ "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 \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"requires_confirmation\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\", 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;",- "});",+ " 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"@@ -3983,26 +4637,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": [{@@ -4021,7 +4655,7 @@"language": "json"}},- "raw": "{\"amount\":0,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"description\":\"[Archipel Connector][Scenario4] - Create Zero auth mandate\",\"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\",\"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",@@ -4031,77 +4665,78 @@"path": ["payments"]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ }},"response": []},{- "name": "Payments - Confirm mandate",+ "name": "Payments - Cancel","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/:id/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.response.to.have.jsonBody();",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","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 \"cancelled\" 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/:id/cancel - Content check if value for 'status' matches 'cancelled'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"cancelled\");",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -4109,26 +4744,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": [{@@ -4138,12 +4753,6 @@{"key": "Accept","value": "application/json"- },- {- "key": "publishable_key",- "value": "pk_snd_8798c6a9114646f8b970b93ad5765ddf",- "type": "text",- "disabled": true}],"body": {@@ -4153,101 +4762,108 @@"language": "json"}},- "raw": "{\"customer_id\":\"{{customer_id}}\",\"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\",\"card_network\":\"Mastercard\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"{{$isoTimestamp}}\",\"online\":{\"ip_address\":\"125.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"multi_use\":{\"amount\":799,\"currency\":\"EUR\",\"start_date\":\"{{$isoTimestamp}}\",\"end_date\":\"2099-01-01T00:00:00Z\",\"metadata\":{\"frequency\":\"13\"}}}}}"+ "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/:id/cancel","host": ["{{baseUrl}}"],"path": ["payments",":id",- "confirm"+ "cancel"],"variable": [{"key": "id",- "value": "{{payment_id}}"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "description": "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 - Create recurring",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );","});","",- "// Validate if response has JSON Body ",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {jsonData = pm.response.json();}catch(e){}",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}","","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );","} else {",- " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",- "};",- "",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}","","// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id","if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(\"- use {{mandate_id}} as collection variable for value\",jsonData.mandate_id);",+ " 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\"",+ "// Response body should have value \"cancelled\" for \"status\"","if (jsonData?.status) {",- "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\", function() {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- "})};",- "",- "// Response body should have \"mandate_id\"",- "pm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {",- " pm.expect((typeof jsonData.mandate_id !== \"undefined\")).to.be.true;",- "});",- "",- "// Response body should have \"mandate_data\"",- "pm.test(\"[POST]::/payments - Content check if 'mandate_data' exists\", function() {",- " pm.expect((typeof jsonData.mandate_data !== \"undefined\")).to.be.true;",- "});",- "",- "// Response body should have \"payment_method_data\"",- "pm.test(\"[POST]::/payments - Content check if 'payment_method_data' exists\", function() {",- " pm.expect((typeof jsonData.payment_method_data !== \"undefined\")).to.be.true;",- "});",+ " pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"cancelled\");",+ " },",+ " );",+ "}",""],"type": "text/javascript"@@ -4255,80 +4871,66 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":799,\"currency\":\"EUR\",\"confirm\":true,\"profile_id\":\"{{profile_id}}\",\"capture_method\":\"automatic\",\"capture_on\":\"{{$isoTimestamp}}\",\"customer_id\":\"{{customer_id}}\",\"description\":\"[Archipel Connector][Scenario4] - Create recurring payment\",\"authentication_type\":\"no_three_ds\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"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\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"},\"order_details\":[{\"product_name\":\"VOD subscription\",\"quantity\":1,\"amount\":799,\"account_name\":\"transaction_processing\"}]}"- },"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario4b-Void a partially captured payment",+ "item": [{- "name": "Payments - Retrieve recurring",+ "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();","});","",@@ -4351,6 +4953,18 @@" );","}","",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}","","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {",@@ -4365,38 +4979,15 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",- "pm.test(",- "\"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ "// 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(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");"," },",- ");",- "",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists is correct \",",- " function () {",- " pm.expect(jsonData.mandate_id).to.eql(pm.collectionVariables.get(\"mandate_id\"));",- " },",- ");",- "",- "// 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"@@ -4404,66 +4995,62 @@}],"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\":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?force_sync=true",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ }},"response": []- }- ]- },- {- "name": "Scenario5-Create a mandate and recurring payment",- "item": [+ },{- "name": "Payments - Create mandate",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -4486,19 +5073,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);",@@ -4512,31 +5086,69 @@" );","}","",- "// 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 \"partially_captured\" for \"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 \"500\" for \"amount\"",+ "pm.test(",+ "\"[post]:://payments/:id/capture - Content check if value for 'amount' matches '500'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.amount).to.eql(500);"," },",- " );",- "}",+ ");","",- "// Response body should have \"mandate_id\"",+ "// Response body should have value \"500\" for \"net_amount\"","pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",+ "\"[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 200\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(200);",+ " },",+ ");",+ "",+ "",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\","," function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)"," },",");","",- "// Response body should have \"mandate_data\"","pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",+ " \"[POST]::/payments - Content check if 'connector' is archipel\","," function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",+ " pm.expect(jsonData.connector).to.be.equal(\"archipel\");"," },",- ");",+ ");"+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -4562,15 +5174,23 @@"language": "json"}},- "raw": "{\"amount\":500,\"currency\":\"EUR\",\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"description\":\"[Archipel Connector][Scenario5] - Create mandate with payment\",\"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_to_capture\":200,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": [- "payments"+ "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"@@ -4578,20 +5198,20 @@"response": []},{- "name": "Payments - Confirm mandate",+ "name": "Payments - Cancel","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - 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/:id/confirm - Content-Type is application/json\",",+ " \"[POST]::/payments/:id/cancel - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -4600,7 +5220,7 @@");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -4623,7 +5243,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -4637,41 +5256,15 @@" );","}","",- "// Response body must not have value \"failed\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' not matches 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.not.eql(\"failed\");",- " },",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"cancelled\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"cancelled\");"," },"," );","}",- "",- "// 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.');",- "};"- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [""],"type": "text/javascript"@@ -4679,26 +5272,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": [{@@ -4717,17 +5290,17 @@"language": "json"}},- "raw": "{\"customer_id\":\"{{customer_id}}\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\",\"card_network\":\"Visa\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"{{$isoTimestamp}}\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"single_use\":{\"amount\":1000,\"currency\":\"EUR\"}}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/:id/cancel","host": ["{{baseUrl}}"],"path": ["payments",":id",- "confirm"+ "cancel"],"variable": [{@@ -4737,12 +5310,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": "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 - Retrieve mandate",+ "name": "Payments - Retrieve","event": [{"listen": "test",@@ -4796,6 +5369,7 @@" \"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);",@@ -4809,31 +5383,15 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"cancelled\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.status).to.eql(\"cancelled\");"," },"," );","}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments/:id - 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/:id - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",""],"type": "text/javascript"@@ -4874,80 +5432,14 @@"description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []- },- {- "name": "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.');",- "}",- "",- "// Response body should have at least one card payment method\"",- "pm.test(",- "\"[GET]::/payment_methods/:customer_id - Content check body has at least one customer_payment_methods\",",- "function () {",- " pm.expect(jsonData.customer_payment_methods.length).greaterThan(0);",- " },",- ");",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },+ }+ ]+ },+ {+ "name": "Scenario4c-Void a successful payment",+ "item": [{- "name": "Payments - Create recurring",+ "name": "Payments - Create","event": [{"listen": "test",@@ -4989,19 +5481,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);",@@ -5015,39 +5494,31 @@" );","}","",- "// 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\"",+ "// Response body should have value \"requires_capture\" for \"status\"","pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",+ "\"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ "function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ "},",");","",- "// Response body should have \"payment_method_data\"",+ "// Response body should have \"connector_transaction_id\"","pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",+ " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\","," function () {",- " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",+ " 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"@@ -5073,7 +5544,7 @@"language": "json"}},- "raw": "{\"amount\":900,\"currency\":\"EUR\",\"confirm\":true,\"profile_id\":\"{{profile_id}}\",\"capture_method\":\"automatic\",\"capture_on\":\"{{$isoTimestamp}}\",\"customer_id\":\"{{customer_id}}\",\"description\":\"[Archipel Connector][Scenario5] - Create recurring payment\",\"authentication_type\":\"no_three_ds\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"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\"}}}"+ "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",@@ -5089,26 +5560,29 @@"response": []},{- "name": "Payments - Retrieve recurring",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");","","// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -5131,7 +5605,6 @@" );","}","",- "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -5145,31 +5618,71 @@" );","}","",- "// 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\");",+ "},",+ ");",+ "",+ "// 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.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.amount).to.eql(500);"," },",- " );",- "}",+ ");","",- "// Response body should have \"mandate_id\"",+ "// Response body should have value \"500\" for \"net_amount\"","pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",+ "\"[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.mandate_id !== \"undefined\").to.be.true;",+ " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",+ " .true;",+ " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)"," },",");","",- "// Response body should have \"mandate_data\"","pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",+ " \"[POST]::/payments - Content check if 'connector' is archipel\","," function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",+ " pm.expect(jsonData.connector).to.be.equal(\"archipel\");"," },",");",+ "",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -5177,154 +5690,177 @@}],"request": {- "method": "GET",+ "method": "POST","header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },{"key": "Accept","value": "application/json"}],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"amount_to_capture\":500,\"statement_descriptor_name\":\"John\",\"statement_descriptor_suffix\":\"JD\"}"+ },"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"+ "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": "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": "Scenario6-Saved card flow",- "item": [+ },{- "name": "Payments - Create first",+ "name": "Payments - Sync payment","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );","});","",- "// Validate if response has JSON Body ",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {jsonData = pm.response.json();}catch(e){}",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}","",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",- "};",+ "// 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.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 - Content check if value for 'net_amount' equal 500\",",+ " function () {",+ " pm.expect(jsonData.net_amount).to.eql(500);",+ " },",+ ");","",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');",- "};",+ "pm.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 value \"requires_payment_method\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(\"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'requires_payment_method'\", function() {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- " })};"+ "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": "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\":\"EUR\",\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"description\":\"[Archipel Connector][Scenario6] - Create payment and save card\",\"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",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []},{- "name": "Payments - Confirm first and save card",+ "name": "Payments - Cancel","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 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/confirm - Content-Type is application/json\",",+ " \"[POST]::/payments/:id/cancel - Content-Type is application/json\","," function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\",",@@ -5333,87 +5869,39 @@");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",+ "// Validate 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\");",+ "});","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Validate if response has \"invalid_request\" error type","pm.test(",- "\"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",- "function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " \"[POST]::/payments/:id/cancel - Response has 'invalid_request' error type\",",+ " function () {",+ " pm.expect(pm.response.json().error).to.have.property(\"type\", \"invalid_request\");"," },",");","",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""+ "// 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"}}],"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": [{@@ -5432,17 +5920,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\",\"card_network\":\"Visa\"}},\"setup_future_usage\":\"off_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"{{$isoTimestamp}}\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments/:id/cancel","host": ["{{baseUrl}}"],"path": ["payments",":id",- "confirm"+ "cancel"],"variable": [{@@ -5452,111 +5940,45 @@}]},- "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": "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": "Payment methods - List and get token",+ "name": "Mandate Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",+ "// 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]::/payment_methods/:customer_id - Content-Type is application/json\", function () {",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","",+ "// Validate if response has JSON Body ",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "","// Set response object as internal variable","let jsonData = {};","try {jsonData = pm.response.json();}catch(e){}","",- "// Response body should have at least one card payment method\"",- "pm.test(",- "\"[GET]::/payment_methods/:customer_id - Content check body has at least one customer_payment_methods\",",- "function () {",- " pm.expect(jsonData.customer_payment_methods.length).greaterThan(0);",- " },",- ");",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Payments - Create second",- "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);",+ "// 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.');","};",@@ -5569,18 +5991,49 @@" console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');","};","",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');",- "};"+ "",+ "// Response body should have value \"requires_payment_method\" for \"status\"",+ "if (jsonData?.status) {",+ "pm.test(\"[POST]::/payments - 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": [{@@ -5599,7 +6052,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"currency\":\"EUR\",\"capture_on\":\"{{$isoTimestamp}}\",\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"customer_id\":\"{{customer_id}}\",\"setup_future_usage\":\"off_session\",\"description\":\"[Archipel Connector][Scenario6] - Create payment with already saved card\",\"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\"}}}"+ "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",@@ -5615,84 +6068,71 @@"response": []},{- "name": "Payments - Confirm second and use saved card",+ "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 status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});","",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "// Validate if response has JSON Body ",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "try {jsonData = pm.response.json();}catch(e){}","","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);","} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",+ " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",+ "};",+ "",+ "",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(\"- use {{mandate_id}} as collection variable for value\",jsonData.mandate_id);",+ "} 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/:id/confirm - 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;",+ "});","",- "// Response body should have value \"cybersource\" 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\");",- " },",- " );",- "}",+ "// 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"@@ -5705,7 +6145,7 @@"apikey": [{"key": "value",- "value": "{{publishable_key}}",+ "value": "{{api_key}}","type": "string"},{@@ -5729,6 +6169,12 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "publishable_key",+ "value": "{{publishable_key}}",+ "type": "text",+ "disabled": true}],"body": {@@ -5738,7 +6184,7 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\",\"card_cvc\":\"123\"}"+ "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/:id/confirm",@@ -5753,8 +6199,7 @@"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{payment_id}}"}]},@@ -5763,61 +6208,77 @@"response": []},{- "name": "Payments - Retrieve",+ "name": "Recurring Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});",+ "",+ "// Validate if response has JSON Body ",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",+ "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 \"mandate_id\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_id !== \"undefined\")).to.be.true;",+ "});",+ "",+ "// Response body should have \"mandate_data\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_data' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_data !== \"undefined\")).to.be.true;",+ "});",+ "",+ "// Response body should have \"payment_method_data\"",+ "pm.test(\"[POST]::/payments - Content check if 'payment_method_data' exists\", function() {",+ " pm.expect((typeof jsonData.payment_method_data !== \"undefined\")).to.be.true;",+ "});",""],"type": "text/javascript"@@ -5825,48 +6286,46 @@}],"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,\"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?force_sync=true",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"},"response": []}]},{- "name": "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": "Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)","item": [{- "name": "Payments - Create",+ "name": "Mandate Payments - Create","event": [{"listen": "test",@@ -5887,19 +6346,10 @@" 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);",@@ -5914,95 +6364,62 @@" console.log(\"- use {{client_secret}} as collection variable for value\",jsonData.client_secret);","} else {"," console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",- "};"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [],- "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": [- "",- "// 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);",- "});",+ "// 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.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 \"mandate_id\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_id !== \"undefined\")).to.be.true;","});","",- "pm.test(\"[POST]::/payments:id/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 \"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:id/incremental_authorizations - Content check if value for 'status' matches 'success'\", function () {",- " // Parse the response JSON",- " var jsonData = pm.response.json();",- "",- " // Check if the 'status' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].status).to.eql(\"success\");",- "});"+ ""],"type": "text/javascript"}}],"request": {+ "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": [],+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],"body": {"mode": "raw","options": {@@ -6010,109 +6427,87 @@"language": "json"}},- "raw": "{\"amount\":1001}"+ "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/{{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;",+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});","",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",+ "// 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.\",",- " );",- "}",- "",- "// 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\");",- " },",- ");",+ " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",+ "};","","",- "// Response body should have value \"1001\" for \"amount\"",+ "// 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/capture - Content check if value for 'amount' matches '1001'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1001);",- " },",- ");",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(\"- use {{client_secret}} as collection variable for value\",jsonData.client_secret);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};","",- "// Response body should have value \"1001\" for \"amount_received\"",+ "// 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/capture - Content check if value for 'amount_received' matches '1001'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(1001);",- " },",- ");",+ "// Response body should have \"mandate_id\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_id !== \"undefined\")).to.be.true;",+ "});","",+ "// Response body should have \"mandate_data\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_data' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_data !== \"undefined\")).to.be.true;",+ "});",""],"type": "text/javascript"@@ -6120,8 +6515,43 @@}],"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": [],+ "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": {@@ -6129,37 +6559,31 @@"language": "json"}},- "raw": "{\"amount_to_capture\":1001}"+ "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/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"+ "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"},"response": []- }- ]- },- {- "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",+ "name": "Recurring Payments - Create","event": [{"listen": "test",@@ -6180,19 +6604,10 @@" 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);",@@ -6207,7 +6622,30 @@" 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;",+ "});",+ "",+ "// 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"}@@ -6215,7 +6653,16 @@],"request": {"method": "POST",- "header": [],+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],"body": {"mode": "raw","options": {@@ -6223,7 +6670,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,\"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",@@ -6233,180 +6680,181 @@"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": "List payment methods for a Customer","event": [{"listen": "test","script": {"exec": [- "",- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx ",+ "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/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(\"[GET]::/payment_methods/:customer_id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","",- "pm.test(\"[POST]::/payments:id/incremental_authorizations - Content check if value for 'status' matches 'success'\", function () {",- " // Parse the response JSON",- " var jsonData = pm.response.json();",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {jsonData = pm.response.json();}catch(e){}","",- " // Check if the 'status' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].status).to.eql(\"success\");",- "});"+ "if (jsonData?.customer_payment_methods[0]?.payment_token) {",+ " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",+ " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",+ "}"],"type": "text/javascript"}}],"request": {- "method": "POST",- "header": [],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":1001}"- },+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],"url": {- "raw": "{{baseUrl}}/payments/{{payment_id}}/incremental_authorization",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "payments",- "{{payment_id}}",- "incremental_authorization"- ]- }- },- "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;",- "});",- "",+ "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",+ "script": {+ "exec": [+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "","// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});","",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "// Validate if response has JSON Body ",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) { }",+ "try {jsonData = pm.response.json();}catch(e){}","","// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id","if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);","} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",+ " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",+ "};",+ "",+ "",+ "// pm.collectionVariables - Set 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 \"partially_captured\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {",- " pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " },",- " );",- "}",+ "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 \"1001\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '1001'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1001);",- " },",- " );",- "}",+ "// Response body should have \"mandate_id\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_id !== \"undefined\")).to.be.true;",+ "});","",- "// Response body should have value \"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 \"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"@@ -6414,8 +6862,43 @@}],"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": [],+ "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": {@@ -6423,33 +6906,33 @@"language": "json"}},- "raw": "{\"amount_to_capture\":600}"+ "raw": "{\"customer_id\":\"{{customer_id}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\"}"},"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": "(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"},"response": []}]},{- "name": "Scenario9a-Refund full payment",+ "name": "Scenario6a-Create a mandate and recurring payment (using mandate_id)","item": [{"name": "Payments - Create",@@ -6494,6 +6977,19 @@" );","}","",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -6517,17 +7013,31 @@" );","}","",- "// 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);",- "});",+ "// 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 \"EUR\" for \"currency\"",- "pm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'EUR'\",",- "function () {",- " pm.expect(jsonData.currency).to.eql(\"EUR\");",- "});",+ "// 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"@@ -6553,7 +7063,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,\"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",@@ -6569,155 +7079,99 @@"response": []},{- "name": "Refunds - Create",+ "name": "Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\","," );","});","",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "","// Set response object as internal variable","let jsonData = {};","try {"," jsonData = pm.response.json();","} catch (e) {}","",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);"," console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\","," );","}","",- "// Response body should have value \"succeeded\" for \"status\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\", ",- "function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- "});",- "",- "// Response body should have value \"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 \"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"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":500,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/refunds",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds"- ]- },- "description": "To create a refund against an already processed payment"- },- "response": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",+ "// 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,"," );",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}","",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);"," console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\","," );","}","",- "// Response body should have value \"succeeded\" for \"status\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\", ",- "function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- "});",+ "// Response body should have value \"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 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 \"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 \"EUR\" for \"currency\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'EUR'\",",- "function () {",- " pm.expect(jsonData.currency).to.eql(\"EUR\");",- "});",+ "// 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"@@ -6733,33 +7187,34 @@}],"url": {- "raw": "{{baseUrl}}/refunds/:id",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "refunds",+ "payments",":id"],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],"variable": [{"key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []- }- ]- },- {- "name": "Scenario9b-Refund partial payment",- "item": [+ },{- "name": "Payments - Create",+ "name": "Recurring Payments - Create","event": [{"listen": "test",@@ -6801,6 +7256,19 @@" );","}","",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -6824,17 +7292,29 @@" );","}","",- "// 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);",- "});",+ "// 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 \"EUR\" for \"currency\"",- "pm.test(\"[POST]::/payments - Content check if value for 'currency' matches 'EUR'\",",- "function () {",- " pm.expect(jsonData.currency).to.eql(\"EUR\");",- "});",+ "// Response body should have \"mandate_data\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have \"payment_method_data\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",+ " },",+ ");",""],"type": "text/javascript"@@ -6860,7 +7340,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,\"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",@@ -6876,155 +7356,99 @@"response": []},{- "name": "Refunds - Create",+ "name": "Recurring Payments - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\","," );","});","",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "","// Set response object as internal variable","let jsonData = {};","try {"," jsonData = pm.response.json();","} catch (e) {}","",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);"," console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\","," );","}","",- "// Response body should have value \"succeeded\" for \"status\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\", ",- "function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- "});",- "",- "// Response body should have value \"200\" for \"amount\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '200'\",",- "function () {",- " pm.expect(jsonData.amount).to.eql(200);",- "});",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}","",- "// Response body should have \"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"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":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",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds"- ]- },- "description": "To create a refund against an already processed payment"- },- "response": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);"," console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\","," );","}","",- "// Response body should have value \"succeeded\" for \"status\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\", ",- "function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- "});",+ "// Response body should have value \"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 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 \"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 \"EUR\" for \"currency\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'EUR'\",",- "function () {",- " pm.expect(jsonData.currency).to.eql(\"EUR\");",- "});",+ "// 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"@@ -7040,33 +7464,39 @@}],"url": {- "raw": "{{baseUrl}}/refunds/:id",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "refunds",+ "payments",":id"],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],"variable": [{"key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"}]},- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []}]},{- "name": "Scenario9c-Refund full incremented payment",+ "name": "Scenario6b-Create a mandate and recurring payment (using connector agnostic)","item": [{- "name": "Payments - Create",+ "name": "Mandate Payments - Create","event": [{"listen": "test",@@ -7087,19 +7517,10 @@" 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);",@@ -7114,15 +7535,62 @@" 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": [],+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],"body": {"mode": "raw","options": {@@ -7130,7 +7598,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,\"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",@@ -7140,179 +7608,77 @@"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": "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;",+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "// 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 - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","",- "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);",+ "// Validate if response has JSON Body ",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","",- "pm.test(\"[POST]::/payments:id/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);",- "});",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {jsonData = pm.response.json();}catch(e){}","",- "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.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:id/incremental_authorizations - Content check if value for 'status' matches 'success'\", function () {",- " // Parse the response JSON",- " var jsonData = pm.response.json();","",- " // Check if the 'status' in the response matches the expected value",- " pm.expect(jsonData.incremental_authorizations[0].status).to.eql(\"success\");",- "});"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":1001}"- },- "url": {- "raw": "{{baseUrl}}/payments/{{payment_id}}/incremental_authorization",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- "{{payment_id}}",- "incremental_authorization"- ]- }- },- "response": []- },- {- "name": "Payments - Capture",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) { }",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",+ "// 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 \"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/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 \"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 \"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"@@ -7320,8 +7686,43 @@}],"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": [],+ "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": {@@ -7329,83 +7730,91 @@"language": "json"}},- "raw": "{\"amount_to_capture\":1001}"+ "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/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"+ "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"},"response": []},{- "name": "Refunds - Create",+ "name": "Recurring Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});",+ "",+ "// Validate if response has JSON Body ",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "try {jsonData = pm.response.json();}catch(e){}","",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",- " console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",- " );",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(\"- use {{payment_id}} as collection variable for value\",jsonData.payment_id);","} else {",- " console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",- " );",- "}",+ " console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');",+ "};","",- "// Response body should have value \"succeeded\" for \"status\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\", ",- "function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ "// 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 value \"1001\" for \"amount\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '1001'\",",- "function () {",- " pm.expect(jsonData.amount).to.eql(1001);",+ "// Response body should have \"mandate_data\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_data' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_data !== \"undefined\")).to.be.true;","});","",- "// Response body should have \"EUR\" for \"currency\"",- "pm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'EUR'\",",- "function () {",- " pm.expect(jsonData.currency).to.eql(\"EUR\");",+ "// 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;","});",""],@@ -7432,205 +7841,191 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":1001,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"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}}/refunds",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "refunds"+ "payments"]},- "description": "To create a refund against an already processed payment"+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"},"response": []- }- ]- },- {- "name": "Scenario10-Create 3DS payment",- "item": [+ },{- "name": "Payments - Create",+ "name": "List payment methods for a Customer","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]::/payment_methods/:customer_id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "pm.test(\"[GET]::/payment_methods/:customer_id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",+ "try {jsonData = pm.response.json();}catch(e){}","",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",+ "if (jsonData?.customer_payment_methods[0]?.payment_token) {",+ " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",+ " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);","} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_payment_method\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""+ " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",+ "}"],"type": "text/javascript"}}],"request": {- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"authentication_type\":\"three_ds\",\"request_external_three_ds_authentication\":true,\"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",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "payments"+ "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 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 filter and list the applicable payment methods for a particular Customer ID"},"response": []},{- "name": "Payments - Confirm",+ "name": "Recurring 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 status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});","",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "// Validate if response has JSON Body ",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "try {jsonData = pm.response.json();}catch(e){}","",- "// Response body should have value \"requires_customer_action\" for \"status\"",- "pm.test(",- "\"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'requires_customer_action'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",- " },",- ");",+ "// 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.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": [+ "// 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\");",+ "})};",+ "",+ "// 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"@@ -7643,7 +8038,7 @@"apikey": [{"key": "value",- "value": "{{publishable_key}}",+ "value": "{{api_key}}","type": "string"},{@@ -7667,6 +8062,12 @@{"key": "Accept","value": "application/json"+ },+ {+ "key": "publishable_key",+ "value": "{{publishable_key}}",+ "type": "text",+ "disabled": true}],"body": {@@ -7676,7 +8077,7 @@"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\"}}"+ "raw": "{\"customer_id\":\"{{customer_id}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\"}"},"url": {"raw": "{{baseUrl}}/payments/:id/confirm",@@ -7691,62 +8092,92 @@"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"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario7-Save card flow",+ "item": [{- "name": "Payments - External 3ds authentication",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"+ "",+ "// 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\");",+ " },",+ " );",+ "}"+ ],+ "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": [{@@ -7765,75 +8196,23 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"device_channel\":\"BRW\",\"threeds_method_comp_ind\":\"Y\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/3ds/authentication",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "3ds",- "authentication"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]+ "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\"}"},- "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 - Authorize request intent",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],"url": {- "raw": "{{baseUrl}}/payments/{{payment_id}}/{{merchant_id}}/authorize/archipel",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- "{{payment_id}}",- "{{merchant_id}}",- "authorize",- "archipel"+ "payments"]},- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"},"response": []},{- "name": "Payments - Retrieve after confirm",+ "name": "Payments - Retrieve","event": [{"listen": "test",@@ -7862,51 +8241,89 @@" 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\"",- "pm.test(",+ "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.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);",- " },",- ");",+ "// Validate the connector",+ "pm.test(\"[POST]::/payments - connector\", function () {",+ " pm.expect(jsonData.connector).to.eql(\"archipel\");",+ "});","",- "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 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 \"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 \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",+ "// Response body should have 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"@@ -7947,198 +8364,168 @@"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": "Negative Cases",- "item": [- {- "name": "Scenario1-Create payment with Invalid card details",- "item": [+ },{- "name": "Payments - Create(Invalid card number)",+ "name": "List payment methods for a Customer","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// Validate status 2xx ",+ "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "pm.test(\"[GET]::/payment_methods/:customer_id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","","// Set response object as internal variable","let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",+ "try {jsonData = pm.response.json();}catch(e){}","",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",+ "if (jsonData?.customer_payment_methods[0]?.payment_token) {",+ " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",+ " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);","} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have \"error\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});",- "",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"connector_error\");",- " },",- " );",- "}",- ""+ " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",+ "}"],"type": "text/javascript"}}],"request": {- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":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\":\"5185\"}},\"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",+ "raw": "{{baseUrl}}/customers/:customer_id/payment_methods","host": ["{{baseUrl}}"],"path": [- "payments"+ "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 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 filter and list the applicable payment methods for a particular Customer ID"},"response": []},{- "name": "Payments - Create(Invalid Exp month)",+ "name": "Save card payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type","pm.test(\"[POST]::/payments - 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.\",",- " );",- "}",- "",- "// Response body should have \"next_action.redirect_to_url\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};","",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- ""+ "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"}@@ -8163,7 +8550,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\":\"24\",\"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,\"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",@@ -8179,26 +8566,29 @@"response": []},{- "name": "Payments - Create(Invalid Exp Year)",+ "name": "Save card payments - Confirm","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/: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();","});","",@@ -8221,6 +8611,19 @@" );","}","",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -8234,27 +8637,23 @@" );","}","",- "// Response body should have \"next_action.redirect_to_url\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});",- "",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}","",- "// Response body should have value \"connector error\" for \"error message\"",- "if (jsonData?.error?.message) {",+ "",+ "// Response body should have value \"archipel\" for \"connector\"",+ "if (jsonData?.connector) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Year'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'archipel'\","," function () {",- " pm.expect(jsonData.error.message).to.eql(\"Invalid Expiry Year\");",+ " pm.expect(jsonData.connector).to.eql(\"archipel\");"," },"," );","}",@@ -8265,6 +8664,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": [{@@ -8283,42 +8702,62 @@"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\":\"1970\",\"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": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_token\":\"{{payment_token}}\",\"card_cvc\":\"7373\"}"},"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 - Create(invalid CVV)",+ "name": "Save card payments - Retrieve","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 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\","," );","});","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -8341,6 +8780,19 @@" );","}","",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "","// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret","if (jsonData?.client_secret) {"," pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",@@ -8354,17 +8806,47 @@" );","}","",- "// Response body should have \"error\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ "// Response body should have value \"Succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ "",+ "// Validate the connector",+ "pm.test(\"[POST]::/payments - connector\", function () {",+ " pm.expect(jsonData.connector).to.eql(\"archipel\");","});","",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",+ "// Response body should have value \"500\" for \"amount\"",+ "if (jsonData?.amount) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '500'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.amount).to.eql(500);",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"500\" for \"amount_received\"",+ "if (jsonData?.amount_received) {",+ " pm.test(",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '500'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(500);",+ " },",+ " );",+ "}",+ "",+ "// 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'\",",+ " function () {",+ " pm.expect(jsonData.amount_capturable).to.eql(0);"," },"," );","}",@@ -8375,43 +8857,45 @@}],"request": {- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":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\":\"00000\",\"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",+ "raw": "{{baseUrl}}/payments/:id?force_sync=true","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []}]},{- "name": "Scenario2-Confirming without payment method",+ "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": "Payments - Create",@@ -8420,65 +8904,49 @@"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.\",",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",- ""+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};"],"type": "text/javascript"}@@ -8486,16 +8954,7 @@],"request": {"method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],+ "header": [],"body": {"mode": "raw","options": {@@ -8503,7 +8962,7 @@"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": "{\"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",@@ -8513,134 +8972,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": "Payments - Confirm",+ "name": "Payments - Incremental Authorization","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/: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 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 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);",+ "});","",- "// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",+ "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 \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""+ "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"}}],"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": {@@ -8648,125 +9042,109 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\"}"+ "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": "Scenario3-Create payment with Manual capture but wrong pan",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.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]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "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,",- " );",+ " 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 \"failed\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'failed'\",",+ "// 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(\"failed\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },",- " );",- "}",+ ");",+ "",+ "",+ "// Response body should have value \"1001\" for \"amount\"","","pm.test(",- " \"[POST]::/payments - Content check if 'connector' is archipel\",",- " function () {",- " pm.expect(jsonData.connector).to.be.equal(\"archipel\");",- " },",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '1001'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(1001);",+ " },",");","",- "// Response body should have \"connector_transaction_id\"",+ "// Response body should have value \"1001\" for \"amount_received\"",+ "","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": [+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '1001'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(1001);",+ " },",+ ");",+ "",""],"type": "text/javascript"@@ -8775,16 +9153,7 @@],"request": {"method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],+ "header": [],"body": {"mode": "raw","options": {@@ -8792,228 +9161,165 @@"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\":\"0000000000000\"}},\"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_to_capture\":1001}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "capture"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "To capture the funds for an uncaptured payment"+ }]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ }},"response": []- },+ }+ ]+ },+ {+ "name": "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 - Retrieve",+ "name": "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) {}",+ "try {jsonData = pm.response.json();}catch(e){}","",- "// Response body should have value \"failed\" for \"status\"",+ "// Response body should have value \"requires_capture\" for \"status\"","pm.test(",- "\"[POST]::/payments/:id - Content check if value for 'status' matches 'failed'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",+ " 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;",- " },",- ");",- "",- "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 'authorization_failed' status\",",- " function () {",- " pm.expect(payment_attempt.status).to.be.equal(\"authorization_failed\");",- " },",- ");",- "",- "",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has 'connector_transaction_id'\",",- " function () {",- " pm.expect(payment_attempt.connector_transaction_id).to.be.equal(",- " pm.collectionVariables.get(\"connector_transaction_id\")",- " );",- " },",- ");",- "",- "pm.test(",- " \"[POST]::/payments - Payment Attempt has archiepl response 'transactionId' in connector_metadata\",",- " function () {",- " pm.expect(payment_attempt.connector_metadata.transactionId).to.be.not.null;",- " pm.collectionVariables.set(\"archipel_transaction_uuid\", payment_attempt.connector_metadata.transactionId)",- " },",- ");",+ "// 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 - Payment Attempt has no error\",",- " function () {",- " pm.expect(payment_attempt.error_message).to.be.null;",- " },",- ");",- ""+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(\"- use {{client_secret}} as collection variable for value\",jsonData.client_secret);",+ "} else {",+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};"],"type": "text/javascript"}}],"request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],+ "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][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/: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": "Scenario4-Capture greater amount",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Incremental Authorization","event": [{"listen": "test","script": {"exec": [+ "","// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",+ "var jsonData = pm.response.json();","",- "// 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: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 \"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: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 \"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)",- " },",- ");"+ "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"}@@ -9021,16 +9327,7 @@],"request": {"method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],+ "header": [],"body": {"mode": "raw","options": {@@ -9038,18 +9335,19 @@"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\":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": []},@@ -9060,9 +9358,9 @@"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",@@ -9084,7 +9382,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) {",@@ -9112,41 +9410,44 @@" );","}","",- "// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",+ "// Response body should have value \"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 \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",+ "// Response body should have value \"1001\" for \"amount\"",+ "if (jsonData?.amount) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '1001'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.amount).to.eql(1001);"," },"," );","}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"+ "",+ "// 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);",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"}- ],+ }+ ],+ "request": {+ "method": "POST",+ "header": [],"body": {"mode": "raw","options": {@@ -9154,7 +9455,7 @@"language": "json"}},- "raw": "{\"amount_to_capture\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "raw": "{\"amount_to_capture\":600}"},"url": {"raw": "{{baseUrl}}/payments/:id/capture",@@ -9173,32 +9474,36 @@"description": "(Required) unique payment id"}]- },- "description": "To capture the funds for an uncaptured payment"+ }},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario9a-Refund full payment",+ "item": [{- "name": "Payments - Retrieve",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\","," );","});","","// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -9234,15 +9539,27 @@" );","}","",- "// Response body should have value \"requires_capture\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",+ "",+ "// Response body should have value \"500\" for \"amount\"",+ "pm.test(\"[POST]::/payments - Content check if value for 'amount' matches '500'\",",+ "function () {",+ " pm.expect(jsonData.amount).to.eql(500);",+ "});",+ "",+ "// 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"@@ -9250,120 +9567,97 @@}],"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\":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/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"},"response": []- }- ]- },- {- "name": "Scenario5-Capture the succeeded payment",- "item": [+ },{- "name": "Payments - Create",+ "name": "Refunds - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\","," );","});","",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "","// Set response object as internal variable","let jsonData = {};","try {"," jsonData = pm.response.json();","} catch (e) {}","",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);"," console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\","," );","}","",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",+ "// Response body should have value \"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 \"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]::/refunds - Content check if value for 'amount' matches '500'\",",+ "function () {",+ " pm.expect(jsonData.amount).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;",- " pm.collectionVariables.set(\"connector_transaction_id\", jsonData.connector_transaction_id)",- " },",- ");",+ "// 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"@@ -9389,99 +9683,83 @@"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": "{\"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",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments"+ "refunds"]},- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ "description": "To create a refund against an already processed payment"},"response": []},{- "name": "Payments - Sync payment",+ "name": "Refunds - Retrieve","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\","," );","});","",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "","// Set response object as internal variable","let jsonData = {};","try {"," jsonData = pm.response.json();","} catch (e) {}","",- "// 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.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 - Content check if value for 'amount_received' equal 500\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(500);",- " },",- ");",+ "// 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 \"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 \"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"- }+ "// 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"+ }}],"request": {@@ -9493,56 +9771,52 @@}],"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/refunds/:id","host": ["{{baseUrl}}"],"path": [- "payments",+ "refunds",":id"],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],"variable": [{"key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"+ "value": "{{refund_id}}",+ "description": "(Required) unique refund id"}]},- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario9b-Refund partial payment",+ "item": [{- "name": "Payments - Capture",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 4xx\", function () {",- " pm.response.to.be.error;",+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -9578,23 +9852,27 @@" );","}","",- "// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\","," function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",+ "",+ "// Response body should have value \"500\" for \"amount\"",+ "pm.test(\"[POST]::/payments - Content check if value for 'amount' matches '500'\",",+ "function () {",+ " pm.expect(jsonData.amount).to.eql(500);",+ "});",+ "",+ "// 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"@@ -9620,127 +9898,79 @@"language": "json"}},- "raw": "{\"amount_to_capture\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ "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/:id/capture",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "description": "To capture the funds for an uncaptured payment"+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"},"response": []- }- ]- },- {- "name": "Scenario6-Create a recurring payment with greater mandate amount",- "item": [+ },{- "name": "Payments - Create",+ "name": "Refunds - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\","," );","});","",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "","// Set response object as internal variable","let jsonData = {};","try {"," jsonData = pm.response.json();","} catch (e) {}","",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);"," console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\","," );","}","",- "// Response body should have value \"requires_confirmation\" for \"status\"",- "pm.test(",- "\"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",+ "// 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(\"requires_confirmation\");",- "},",- ");",+ " 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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",+ "// Response body should have value \"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 \"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 \"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"@@ -9766,86 +9996,78 @@"language": "json"}},- "raw": "{\"amount\":0,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"customer_id\":\"{{customer_id}}\",\"profile_id\":\"{{profile_id}}\",\"description\":\"[Archipel Connector][Variation Cases][Scenario6] - Create mandate\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\",\"card_network\":\"Visa\"}},\"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\":1000,\"currency\":\"EUR\"}}},\"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\":\"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\"}}}"+ "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}}/payments",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments"+ "refunds"]},- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ "description": "To create a refund against an already processed payment"},"response": []},{- "name": "Payments - Confirm",+ "name": "Refunds - 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(\"[POST]::/refunds - Status code is 2xx\", function () {",+ " pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",- "});",- "",- "// Validate if response has JSON Body ",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "pm.test(\"[POST]::/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){}",+ "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 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 {{payment_id}}, as jsonData.payment_id is undefined.');",- "};",+ " console.log(",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_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 mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(\"- use {{mandate_id}} as collection variable for value\",jsonData.mandate_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.');",- "};",+ "// Response body should have value \"200\" for \"amount\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '200'\",",+ "function () {",+ " pm.expect(jsonData.amount).to.eql(200);",+ "});","",- "// 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 \"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 \"EUR\" for \"currency\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'currency' matches 'EUR'\",",+ "function () {",+ " pm.expect(jsonData.currency).to.eql(\"EUR\");","});",""],@@ -9854,282 +10076,169 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",+ "method": "GET","header": [- {- "key": "Content-Type",- "value": "application/json"- },{"key": "Accept","value": "application/json"- },- {- "key": "publishable_key",- "value": "pk_snd_8798c6a9114646f8b970b93ad5765ddf",- "type": "text",- "disabled": true}],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"customer_id\":\"{{customer_id}}\",\"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\",\"card_network\":\"Mastercard\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"{{$isoTimestamp}}\",\"online\":{\"ip_address\":\"125.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"multi_use\":{\"amount\":799,\"currency\":\"EUR\",\"start_date\":\"{{$isoTimestamp}}\",\"end_date\":\"2099-01-01T00:00:00Z\",\"metadata\":{\"frequency\":\"13\"}}}}}"- },"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/refunds/:id","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"+ "refunds",+ ":id"],"variable": [{"key": "id",- "value": "{{payment_id}}"+ "value": "{{refund_id}}",+ "description": "(Required) unique refund id"}]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"},"response": []- },+ }+ ]+ },+ {+ "name": "Scenario9c-Refund full incremented payment",+ "item": [{- "name": "Payments - Retrieve",+ "name": "Payments - Create","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.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){}",+ "",+ "// 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.\",",- " );",- "}",- "",- "// 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;",- " },",- ");",- ""+ " console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');",+ "};"],"type": "text/javascript"}}],"request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],+ "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/:id?force_sync=true",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ }},"response": []},{- "name": "Recurring Payments - Create",+ "name": "Payments - Incremental Authorization","event": [{"listen": "test","script": {"exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});","",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",+ "// Validate 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 - 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) {}",+ "var jsonData = pm.response.json();","",- "// 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: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 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 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.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 '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 \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",+ "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 \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- ""+ " // Check if the 'status' in the response matches the expected value",+ " pm.expect(jsonData.incremental_authorizations[0].status).to.eql(\"success\");",+ "});"],"type": "text/javascript"}@@ -10137,16 +10246,7 @@],"request": {"method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],+ "header": [],"body": {"mode": "raw","options": {@@ -10154,118 +10254,109 @@"language": "json"}},- "raw": "{\"amount\":9000,\"currency\":\"EUR\",\"confirm\":true,\"profile_id\":\"{{profile_id}}\",\"capture_method\":\"automatic\",\"capture_on\":\"{{$isoTimestamp}}\",\"customer_id\":\"{{customer_id}}\",\"description\":\"[Archipel Connector][Variation Cases][Scenario6] - Create recurring payment greater than mandate amount\",\"authentication_type\":\"no_three_ds\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"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\"}}}"+ "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": "Scenario7-Create a card payment without card scheme",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Capture","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.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]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",+ "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,",- " );",+ " 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\");",- "},",+ " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",");","",- "// Response body should have \"mandate_id\"",+ "",+ "// Response body should have value \"1001\" for \"amount\"",+ "","pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",+ " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '1001'\",",+ " function () {",+ " pm.expect(jsonData.amount).to.eql(1001);",+ " },",");","",- "// Response body should have \"mandate_data\"",+ "// Response body should have value \"1001\" for \"amount_received\"",+ "","pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",+ " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '1001'\",",+ " function () {",+ " pm.expect(jsonData.amount_received).to.eql(1001);",+ " },",");",+ "",""],"type": "text/javascript"@@ -10274,16 +10365,7 @@],"request": {"method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],+ "header": [],"body": {"mode": "raw","options": {@@ -10291,141 +10373,147 @@"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\":\"[Archipel Connector][Variation Cases][Scenario7] - Create card payment without passing card scheme\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"}}}"+ "raw": "{\"amount_to_capture\":1001}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/capture","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "capture"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "To capture the funds for an uncaptured payment"+ }]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ }},"response": []},{- "name": "Payments - Retrieve",+ "name": "Refunds - Create","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\","," );","});","",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "","// Set response object as internal variable","let jsonData = {};","try {"," jsonData = pm.response.json();","} catch (e) {}","",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);"," console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\","," );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",- "pm.test(",- "\"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ "// 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(\"succeeded\");",- "},",- ");",+ " 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\"",+ "pm.test(\"[POST]::/refunds - Content check if value for 'amount' matches '1001'\",",+ "function () {",+ " pm.expect(jsonData.amount).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"}}],"request": {- "method": "GET",+ "method": "POST","header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },{"key": "Accept","value": "application/json"}],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":1001,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ },"url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "raw": "{{baseUrl}}/refunds","host": ["{{baseUrl}}"],"path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "refunds"]},- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ "description": "To create a refund against an already processed payment"},"response": []}]- },+ }+ ]+ },+ {+ "name": "Negative Cases",+ "item": [{- "name": "Scenario8-Void succeeded payment",+ "name": "Scenario1-Create payment with Invalid card details","item": [{- "name": "Payments - Create",+ "name": "Payments - Create(Invalid card number)","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 4xx",+ "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",+ " pm.response.to.be.error;","});","","// Validate if response header has matching content-type",@@ -10472,12 +10560,17 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",+ "// Response body should have \"error\"",+ "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ "});",+ "",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.error.type).to.eql(\"connector_error\");"," },"," );","}",@@ -10506,7 +10599,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"phone_country_code\":\"+91\",\"description\":\"[Archipel][Connector][VariationCases][Scenario8] - Try to cancel success payment\",\"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\":\"5185\"}},\"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",@@ -10522,29 +10615,26 @@"response": []},{- "name": "Payments - Cancel",+ "name": "Payments - Create(Invalid Exp month)","event": [{"listen": "test","script": {"exec": ["// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/cancel - Status code is 4xx\", function () {",+ "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {"," pm.response.to.be.error;","});","","// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/cancel - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -10580,18 +10670,15 @@" );","}","",- "// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",+ "// Response body should have \"next_action.redirect_to_url\"",+ "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ "});","","// Response body should have value \"connector error\" for \"error type\"","if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {"," pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },",@@ -10622,45 +10709,31 @@"language": "json"}},- "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"+ "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\":\"24\",\"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/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": "Scenario9-Refund exceeds amount",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Create(Invalid Exp Year)","event": [{"listen": "test","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",+ "// Validate status 4xx",+ "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",+ " pm.response.to.be.error;","});","","// Validate if response header has matching content-type",@@ -10707,12 +10780,27 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",+ "// Response body should have \"next_action.redirect_to_url\"",+ "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ "});",+ "",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"connector error\" for \"error message\"",+ "if (jsonData?.error?.message) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Year'\",",+ " function () {",+ " pm.expect(jsonData.error.message).to.eql(\"Invalid Expiry Year\");"," },"," );","}",@@ -10741,7 +10829,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\":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\":\"1970\",\"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",@@ -10757,55 +10845,70 @@"response": []},{- "name": "Refunds - Create",+ "name": "Payments - Create(invalid CVV)","event": [{"listen": "test","script": {"exec": ["// Validate status 4xx",- "pm.test(\"[POST]::/refunds - Status code is 4xx\", function () {",+ "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {"," pm.response.to.be.error;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {"," pm.expect(pm.response.headers.get(\"Content-Type\")).to.include("," \"application/json\","," );","});","",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "","// Set response object as internal variable","let jsonData = {};","try {"," jsonData = pm.response.json();","} catch (e) {}","",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);"," console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,"," );","} else {"," console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\","," );","}","","// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",+ "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ "});","","// Response body should have value \"connector error\" for \"error type\"","if (jsonData?.error?.type) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " \"[POST]::/payments - Content check if value for 'error.type' matches 'invalid_request'\","," function () {"," pm.expect(jsonData.error.type).to.eql(\"invalid_request\");"," },",@@ -10836,25 +10939,25 @@"language": "json"}},- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":7000,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"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\":\"00000\",\"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}}/refunds",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "refunds"+ "payments"]},- "description": "To create a refund against an already processed payment"+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"},"response": []}]},{- "name": "Scenario10-Refund for unsuccessful payment",+ "name": "Scenario2-Confirming without payment method","item": [{"name": "Payments - Create",@@ -10912,12 +11015,12 @@" );","}","",- "// Response body should have value \"requires_confirmation\" for \"status\"",+ "// Response body should have value \"requires_payment_method\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",@@ -10946,7 +11049,7 @@"language": "json"}},- "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":false,\"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\":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",@@ -10959,104 +11062,4363 @@},"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": []+ "response": []+ },+ {+ "name": "Payments - Confirm",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 4xx",+ "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",+ " pm.response.to.be.error;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have \"error\"",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " function () {",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "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}}\"}"+ },+ "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": "Scenario3-Create payment with Manual capture but wrong pan",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'connector' is archipel\",",+ " function () {",+ " pm.expect(jsonData.connector).to.be.equal(\"archipel\");",+ " },",+ ");",+ "",+ "// Response body should have value \"failed\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'failed'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"failed\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have value \"Transaction error: No Response from acquirer\" for \"error_message\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'error_message' matches 'Transaction error: No Response from acquirer'\",",+ " function () {",+ " pm.expect(jsonData.error_message).to.eql(\"Transaction error: No Response from acquirer\");",+ " },",+ " );",+ "}",+ "",+ "// 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\":\"0000000000000\"}},\"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 400",+ "pm.test(\"[POST]::/payments/:id/capture - 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\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Validate 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/confirm - Error type is 'invalid_request'\",",+ " function () {",+ " pm.expect(jsonData.error).to.have.property(\"type\", \"invalid_request\");",+ " },",+ ");",+ "",+ "// Validate if error message is \"This Payment could not be captured because it has a payment.status of failed. The expected state is requires_capture, partially_captured_and_capturable, processing\"",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Error message is 'This Payment could not be captured because it has a payment.status of failed. The expected state is requires_capture, partially_captured_and_capturable, processing'\",",+ " function () {",+ " pm.expect(jsonData.error).to.have.property(",+ " \"message\",",+ " \"This Payment could not be captured because it has a payment.status of failed. The expected state is requires_capture, partially_captured_and_capturable, processing\",",+ " );",+ " },",+ ");"+ ],+ "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 - Retrieve",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// Response body should have value \"failed\" for \"status\"",+ "pm.test(",+ "\"[POST]::/payments/:id - Content check if value for 'status' matches 'failed'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"failed\");",+ " },",+ ");",+ "",+ "// 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;",+ " },",+ ");",+ "",+ "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 'failure' status\",",+ " function () {",+ " pm.expect(payment_attempt.status).to.be.equal(\"failure\");",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments - Payment Attempt has 'archipel' connector\",",+ " function () {",+ " pm.expect(payment_attempt.connector).to.be.equal(\"archipel\");",+ " },",+ ");",+ "",+ "pm.test(",+ " \"[POST]::/payments - Payment Attempt has 'Transaction error: No Response from acquirer' error_message\",",+ " function () {",+ " pm.expect(payment_attempt.error_message).to.be.equal(\"Transaction error: No Response from acquirer\");",+ " },",+ ");"+ ],+ "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"+ }+ ],+ "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": "Scenario4-Capture greater amount",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"requires_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"+ }+ }+ ],+ "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 4xx",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 4xx\", function () {",+ " pm.response.to.be.error;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have \"error\"",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " function () {",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "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\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments/:id/capture",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id",+ "capture"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }+ ]+ },+ "description": "To capture the funds for an uncaptured payment"+ },+ "response": []+ },+ {+ "name": "Payments - Retrieve",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"requires_capture\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_capture\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "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": "Scenario5-Capture the succeeded payment",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " 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\",",+ " 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"+ }+ }+ ],+ "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\":\"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"+ ]+ },+ "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 - Capture",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 4xx",+ "pm.test(\"[POST]::/payments/:id/capture - Status code is 4xx\", function () {",+ " pm.response.to.be.error;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(",+ " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have \"error\"",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " function () {",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "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\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments/:id/capture",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id",+ "capture"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }+ ]+ },+ "description": "To capture the funds for an uncaptured payment"+ },+ "response": []+ }+ ]+ },+ {+ "name": "Scenario6-Create a recurring payment with greater mandate amount",+ "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\"",+ "pm.test(",+ "\"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",+ "function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",+ "},",+ ");",+ "",+ "// Response body should have \"mandate_id\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have \"mandate_data\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",+ " },",+ ");",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"amount\":0,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"customer_id\":\"{{customer_id}}\",\"profile_id\":\"{{profile_id}}\",\"description\":\"[Archipel Connector][Variation Cases][Scenario6] - Create mandate\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_cvc\":\"123\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_number\":\"5185570141917102\",\"card_network\":\"Visa\"}},\"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\":1000,\"currency\":\"EUR\"}}},\"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\":\"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\"}}}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments"+ ]+ },+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ },+ "response": []+ },+ {+ "name": "Payments - Confirm",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx ",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",+ "});",+ "",+ "// Validate if response has JSON Body ",+ "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 \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ "pm.test(\"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\", function() {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ "})};",+ "",+ "// Response body should have \"mandate_id\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_id' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_id !== \"undefined\")).to.be.true;",+ "});",+ "",+ "// Response body should have \"mandate_data\"",+ "pm.test(\"[POST]::/payments - Content check if 'mandate_data' exists\", function() {",+ " pm.expect((typeof jsonData.mandate_data !== \"undefined\")).to.be.true;",+ "});",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{api_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ },+ {+ "key": "publishable_key",+ "value": "{{publishable_key}}",+ "type": "text",+ "disabled": true+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"customer_id\":\"{{customer_id}}\",\"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\",\"card_network\":\"Mastercard\"}},\"setup_future_usage\":\"off_session\",\"payment_type\":\"setup_mandate\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"{{$isoTimestamp}}\",\"online\":{\"ip_address\":\"125.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"multi_use\":{\"amount\":799,\"currency\":\"EUR\",\"start_date\":\"{{$isoTimestamp}}\",\"end_date\":\"2099-01-01T00:00:00Z\",\"metadata\":{\"frequency\":\"13\"}}}}}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments/:id/confirm",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id",+ "confirm"+ ],+ "variable": [+ {+ "key": "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"+ },+ "response": []+ },+ {+ "name": "Payments - Retrieve",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"Succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have \"mandate_id\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have \"mandate_data\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",+ " },",+ ");",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {+ "raw": "{{baseUrl}}/payments/: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": "Recurring Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 4xx",+ "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",+ " pm.response.to.be.error;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have \"error\"",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have value \"invalid_request\" for \"error type\"",+ "if (jsonData?.error?.type) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " function () {",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"amount\":9000,\"currency\":\"EUR\",\"confirm\":true,\"profile_id\":\"{{profile_id}}\",\"capture_method\":\"automatic\",\"capture_on\":\"{{$isoTimestamp}}\",\"customer_id\":\"{{customer_id}}\",\"description\":\"[Archipel Connector][Variation Cases][Scenario6] - Create recurring payment greater than mandate amount\",\"authentication_type\":\"no_three_ds\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"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\"}}}"+ },+ "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": "Scenario7-Create a card payment without card scheme",+ "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 \"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 \"mandate_id\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_id' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have \"mandate_data\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'mandate_data' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",+ " },",+ ");",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "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\":\"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\":\"[Archipel Connector][Variation Cases][Scenario7] - Create card payment without passing card scheme\",\"billing\":{\"address\":{\"line1\":\"2 ter\",\"line2\":\"rue du château\",\"line3\":\"\",\"city\":\"Neuilly-sur-Seine\",\"state\":\"France\",\"zip\":\"92200\",\"country\":\"FR\"}}}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments"+ ]+ },+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ },+ "response": []+ },+ {+ "name": "Payments - Retrieve",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"Succeeded\" for \"status\"",+ "pm.test(",+ "\"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ "function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ "},",+ ");",+ "",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {+ "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": "Scenario8-Void succeeded payment",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"amount\":500,\"amount_to_capture\":500,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"automatic\",\"authentication_type\":\"no_three_ds\",\"profile_id\":\"{{profile_id}}\",\"phone_country_code\":\"+91\",\"description\":\"[Archipel][Connector][VariationCases][Scenario8] - Try to cancel success payment\",\"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"+ ]+ },+ "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 - Cancel",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 4xx",+ "pm.test(\"[POST]::/payments/:id/cancel - Status code is 4xx\", function () {",+ " pm.response.to.be.error;",+ "});",+ "",+ "// Validate 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();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have \"error\"",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " function () {",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments/:id/cancel",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id",+ "cancel"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }+ ]+ },+ "description": "A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action"+ },+ "response": []+ }+ ]+ },+ {+ "name": "Scenario9-Refund exceeds amount",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"amount\":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",+ "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": "Refunds - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 4xx",+ "pm.test(\"[POST]::/refunds - Status code is 4xx\", function () {",+ " pm.response.to.be.error;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ " console.log(",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have \"error\"",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have value \"connector error\" for \"error type\"",+ "if (jsonData?.error?.type) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " function () {",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":7000,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ },+ "url": {+ "raw": "{{baseUrl}}/refunds",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "refunds"+ ]+ },+ "description": "To create a refund against an already processed payment"+ },+ "response": []+ }+ ]+ },+ {+ "name": "Scenario10-Refund for unsuccessful payment",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"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\":\"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",+ "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": "Refunds - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 4xx",+ "pm.test(\"[POST]::/refunds - Status code is 4xx\", function () {",+ " pm.response.to.be.error;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",+ "if (jsonData?.refund_id) {",+ " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",+ " console.log(",+ " \"- use {{refund_id}} as collection variable for value\",",+ " jsonData.refund_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have \"error\"",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",+ " },",+ ");",+ "",+ "// Response body should have value \"invalid_request\" for \"error type\"",+ "if (jsonData?.error?.type) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",+ " function () {",+ " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ },+ "url": {+ "raw": "{{baseUrl}}/refunds",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "refunds"+ ]+ },+ "description": "To create a refund against an already processed payment"+ },+ "response": []+ }+ ]+ }+ ]+ }+ ]+ },+ {+ "name": "Netcetera Testcases",+ "item": [+ {+ "name": "Scenario1-Create 3DS payment with confirm true",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Verify if 'external_3ds_authentication_attempted' is true",+ "pm.test(\"[POST]::/payments - 'external_3ds_authentication_attempted' should be true\", function () {",+ " pm.expect(jsonData.external_3ds_authentication_attempted).to.be.true;",+ "});",+ "",+ "// Response body should have value \"requires_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content Verify if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ "",+ "// Verify if 'next_action' exists",+ "pm.test(\"[POST]::/payments - Should contain 'next_action'\", function () {",+ " pm.expect(jsonData).to.have.property(\"next_action\");",+ "});",+ "",+ "// Verify if 'next_action.type' is 'three_ds_invoke'",+ "pm.test(\"[POST]::/payments - 'next_action.type' should be 'three_ds_invoke'\", function () {",+ " pm.expect(jsonData.next_action.type).to.eql(\"three_ds_invoke\");",+ "});",+ "",+ "// Verify if 'three_ds_data' exists inside 'next_action'",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_data' under 'next_action'\", function () {",+ " pm.expect(jsonData.next_action).to.have.property(\"three_ds_data\");",+ "});",+ "",+ "// Verify if 'three_ds_authentication_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_authentication_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"three_ds_authentication_url\");",+ "});",+ "",+ "// Verify if 'three_ds_authorize_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_authorize_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"three_ds_authorize_url\");",+ "});",+ "",+ "// Verify if 'three_ds_method_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_method_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.three_ds_method_details).to.have.property(\"three_ds_method_url\");",+ "});",+ "",+ "// Verify if 'three_ds_method_data' exists and is not empty",+ "// Carries session-specific metadata for fingerprinting — must exist and be valid Base64.",+ "pm.test(\"[POST]::/payments - Should contain non-empty 'three_ds_method_data'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.three_ds_method_details).to.have.property(\"three_ds_method_data\").that.is.a('string').and.is.not.empty;",+ "});",+ "",+ "// Verify if 'poll_id' exists inside 'poll_config'",+ "// Polling is required to check 3DS status asynchronously while Netcetera finishes auth.",+ "pm.test(\"[POST]::/payments - Should contain 'poll_id' inside 'poll_config'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.poll_config).to.have.property(\"poll_id\");",+ "});",+ "",+ "// Verify if 'message_version' exists and is 2.1.0 or higher",+ "// Ensures compatibility with supported Netcetera protocol versions (2.1.0 and above).",+ "pm.test(\"[POST]::/payments - 'message_version' should exist and be >= 2.1.0\", function () {",+ " const version = jsonData.next_action.three_ds_data.message_version;",+ " pm.expect(version).to.match(/^2\\.(1|2|3)(\\.\\d+)?$/);",+ "});",+ "",+ "// Verify if 'directory_server_id' exists",+ "// Identifies the card network’s Directory Server (e.g., Visa = A000000003) for Netcetera routing.",+ "pm.test(\"[POST]::/payments - Should contain 'directory_server_id'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"directory_server_id\").that.is.a('string');",+ "});",+ "",+ "// Assert 'external_authentication_details' exists",+ "pm.test(\"[POST]::/payments - Should contain 'external_authentication_details'\", function () {",+ " pm.expect(jsonData).to.have.property(\"external_authentication_details\");",+ "});",+ "",+ "// Assert 'status' is 'pending' at the start of 3DS",+ "pm.test(\"[POST]::/payments - external_authentication_details.status should be 'pending'\", function () {",+ " pm.expect(jsonData.external_authentication_details.status).to.eql(\"pending\");",+ "});",+ "",+ "// Assert 'ds_transaction_id' exists (required for Netcetera 3DS tracking)",+ "pm.test(\"[POST]::/payments - Should contain 'ds_transaction_id'\", function () {",+ " pm.expect(jsonData.external_authentication_details.ds_transaction_id).to.be.a('string').and.is.not.empty;",+ "});",+ "",+ "// Assert 'version' is present and valid",+ "pm.test(\"[POST]::/payments - Should contain 3DS version\", function () {",+ " pm.expect(jsonData.external_authentication_details.version).to.match(/^2\\.(1|2|3)(\\.\\d+)?$/);",+ "});",+ ""+ ],+ "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\":\"automatic\",\"authentication_type\":\"three_ds\",\"request_external_three_ds_authentication\":true,\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4123400073320224\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"123\"}},\"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 - Retrieve",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set 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_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "GET",+ "header": [+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "url": {+ "raw": "{{baseUrl}}/payments/:id?force_sync=true",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id"+ ],+ "query": [+ {+ "key": "force_sync",+ "value": "true"+ }+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }+ ]+ },+ "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"+ },+ "response": []+ }+ ]+ },+ {+ "name": "Scenario2-Create 3DS payment with confirm false",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"requires_payment_method\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "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\":\"three_ds\",\"request_external_three_ds_authentication\":true,\"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"+ ]+ },+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ },+ "response": []+ },+ {+ "name": "Payments - Confirm",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "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.\",",+ " );",+ "}",+ "",+ "// Verify if 'external_3ds_authentication_attempted' is true",+ "pm.test(\"[POST]::/payments - 'external_3ds_authentication_attempted' should be true\", function () {",+ " pm.expect(jsonData.external_3ds_authentication_attempted).to.be.true;",+ "});",+ "",+ "// Response body should have value \"requires_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content Verify if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ "",+ "// Verify if 'next_action' exists",+ "pm.test(\"[POST]::/payments - Should contain 'next_action'\", function () {",+ " pm.expect(jsonData).to.have.property(\"next_action\");",+ "});",+ "",+ "// Verify if 'next_action.type' is 'three_ds_invoke'",+ "pm.test(\"[POST]::/payments - 'next_action.type' should be 'three_ds_invoke'\", function () {",+ " pm.expect(jsonData.next_action.type).to.eql(\"three_ds_invoke\");",+ "});",+ "",+ "// Verify if 'three_ds_data' exists inside 'next_action'",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_data' under 'next_action'\", function () {",+ " pm.expect(jsonData.next_action).to.have.property(\"three_ds_data\");",+ "});",+ "",+ "// Verify if 'three_ds_authentication_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_authentication_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"three_ds_authentication_url\");",+ "});",+ "",+ "// Verify if 'three_ds_authorize_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_authorize_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"three_ds_authorize_url\");",+ "});",+ "",+ "// Verify if 'three_ds_method_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_method_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.three_ds_method_details).to.have.property(\"three_ds_method_url\");",+ "});",+ "",+ "// Verify if 'three_ds_method_data' exists and is not empty",+ "// Carries session-specific metadata for fingerprinting — must exist and be valid Base64.",+ "pm.test(\"[POST]::/payments - Should contain non-empty 'three_ds_method_data'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.three_ds_method_details).to.have.property(\"three_ds_method_data\").that.is.a('string').and.is.not.empty;",+ "});",+ "",+ "// Verify if 'poll_id' exists inside 'poll_config'",+ "// Polling is required to check 3DS status asynchronously while Netcetera finishes auth.",+ "pm.test(\"[POST]::/payments - Should contain 'poll_id' inside 'poll_config'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.poll_config).to.have.property(\"poll_id\");",+ "});",+ "",+ "// Verify if 'message_version' exists and is 2.1.0 or higher",+ "// Ensures compatibility with supported Netcetera protocol versions (2.1.0 and above).",+ "pm.test(\"[POST]::/payments - 'message_version' should exist and be >= 2.1.0\", function () {",+ " const version = jsonData.next_action.three_ds_data.message_version;",+ " pm.expect(version).to.match(/^2\\.(1|2|3)(\\.\\d+)?$/);",+ "});",+ "",+ "// Verify if 'directory_server_id' exists",+ "// Identifies the card network’s Directory Server (e.g., Visa = A000000003) for Netcetera routing.",+ "pm.test(\"[POST]::/payments - Should contain 'directory_server_id'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"directory_server_id\").that.is.a('string');",+ "});",+ "",+ "// Assert 'external_authentication_details' exists",+ "pm.test(\"[POST]::/payments - Should contain 'external_authentication_details'\", function () {",+ " pm.expect(jsonData).to.have.property(\"external_authentication_details\");",+ "});",+ "",+ "// Assert 'status' is 'pending' at the start of 3DS",+ "pm.test(\"[POST]::/payments - external_authentication_details.status should be 'pending'\", function () {",+ " pm.expect(jsonData.external_authentication_details.status).to.eql(\"pending\");",+ "});",+ "",+ "// Assert 'ds_transaction_id' exists (required for Netcetera 3DS tracking)",+ "pm.test(\"[POST]::/payments - Should contain 'ds_transaction_id'\", function () {",+ " pm.expect(jsonData.external_authentication_details.ds_transaction_id).to.be.a('string').and.is.not.empty;",+ "});",+ "",+ "// Assert 'version' is present and valid",+ "pm.test(\"[POST]::/payments - Should contain 3DS version\", function () {",+ " pm.expect(jsonData.external_authentication_details.version).to.match(/^2\\.(1|2|3)(\\.\\d+)?$/);",+ "});",+ ""+ ],+ "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\":\"4123400073320224\"}},\"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 - Retrieve",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set 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_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments:id - Content check if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ ""+ ],+ "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": "Scenario3-Create 3DS Frictionless payment with Visa",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Verify if 'external_3ds_authentication_attempted' is true",+ "pm.test(\"[POST]::/payments - 'external_3ds_authentication_attempted' should be true\", function () {",+ " pm.expect(jsonData.external_3ds_authentication_attempted).to.be.true;",+ "});",+ "",+ "// Response body should have value \"requires_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content Verify if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ "",+ "// Verify if 'next_action' exists",+ "pm.test(\"[POST]::/payments - Should contain 'next_action'\", function () {",+ " pm.expect(jsonData).to.have.property(\"next_action\");",+ "});",+ "",+ "// Verify if 'next_action.type' is 'three_ds_invoke'",+ "pm.test(\"[POST]::/payments - 'next_action.type' should be 'three_ds_invoke'\", function () {",+ " pm.expect(jsonData.next_action.type).to.eql(\"three_ds_invoke\");",+ "});",+ "",+ "// Verify if 'three_ds_data' exists inside 'next_action'",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_data' under 'next_action'\", function () {",+ " pm.expect(jsonData.next_action).to.have.property(\"three_ds_data\");",+ "});",+ "",+ "// Verify if 'three_ds_authentication_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_authentication_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"three_ds_authentication_url\");",+ "});",+ "",+ "// Verify if 'three_ds_authorize_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_authorize_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"three_ds_authorize_url\");",+ "});",+ "",+ "// Verify if 'three_ds_method_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_method_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.three_ds_method_details).to.have.property(\"three_ds_method_url\");",+ "});",+ "",+ "// Verify if 'three_ds_method_data' exists and is not empty",+ "// Carries session-specific metadata for fingerprinting — must exist and be valid Base64.",+ "pm.test(\"[POST]::/payments - Should contain non-empty 'three_ds_method_data'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.three_ds_method_details).to.have.property(\"three_ds_method_data\").that.is.a('string').and.is.not.empty;",+ "});",+ "",+ "// Verify if 'poll_id' exists inside 'poll_config'",+ "// Polling is required to check 3DS status asynchronously while Netcetera finishes auth.",+ "pm.test(\"[POST]::/payments - Should contain 'poll_id' inside 'poll_config'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.poll_config).to.have.property(\"poll_id\");",+ "});",+ "",+ "// Verify if 'message_version' exists and is 2.1.0 or higher",+ "// Ensures compatibility with supported Netcetera protocol versions (2.1.0 and above).",+ "pm.test(\"[POST]::/payments - 'message_version' should exist and be >= 2.1.0\", function () {",+ " const version = jsonData.next_action.three_ds_data.message_version;",+ " pm.expect(version).to.match(/^2\\.(1|2|3)(\\.\\d+)?$/);",+ "});",+ "",+ "// Verify if 'directory_server_id' exists",+ "// Identifies the card network’s Directory Server (e.g., Visa = A000000003) for Netcetera routing.",+ "pm.test(\"[POST]::/payments - Should contain 'directory_server_id'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"directory_server_id\").that.is.a('string');",+ "});",+ "",+ "// Assert 'external_authentication_details' exists",+ "pm.test(\"[POST]::/payments - Should contain 'external_authentication_details'\", function () {",+ " pm.expect(jsonData).to.have.property(\"external_authentication_details\");",+ "});",+ "",+ "// Assert 'status' is 'pending' at the start of 3DS",+ "pm.test(\"[POST]::/payments - external_authentication_details.status should be 'pending'\", function () {",+ " pm.expect(jsonData.external_authentication_details.status).to.eql(\"pending\");",+ "});",+ "",+ "// Assert 'ds_transaction_id' exists (required for Netcetera 3DS tracking)",+ "pm.test(\"[POST]::/payments - Should contain 'ds_transaction_id'\", function () {",+ " pm.expect(jsonData.external_authentication_details.ds_transaction_id).to.be.a('string').and.is.not.empty;",+ "});",+ "",+ "// Assert 'version' is present and valid",+ "pm.test(\"[POST]::/payments - Should contain 3DS version\", function () {",+ " pm.expect(jsonData.external_authentication_details.version).to.match(/^2\\.(1|2|3)(\\.\\d+)?$/);",+ "});",+ ""+ ],+ "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\":\"automatic\",\"authentication_type\":\"three_ds\",\"request_external_three_ds_authentication\":true,\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4123400073320224\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"123\"}},\"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 - Retrieve",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set 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_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ ""+ ],+ "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": "Scenario4-Create 3DS Frictionless payment with Mastercard",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Verify if 'external_3ds_authentication_attempted' is true",+ "pm.test(\"[POST]::/payments - 'external_3ds_authentication_attempted' should be true\", function () {",+ " pm.expect(jsonData.external_3ds_authentication_attempted).to.be.true;",+ "});",+ "",+ "// Response body should have value \"requires_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content Verify if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ "",+ "// Verify if 'next_action' exists",+ "pm.test(\"[POST]::/payments - Should contain 'next_action'\", function () {",+ " pm.expect(jsonData).to.have.property(\"next_action\");",+ "});",+ "",+ "// Verify if 'next_action.type' is 'three_ds_invoke'",+ "pm.test(\"[POST]::/payments - 'next_action.type' should be 'three_ds_invoke'\", function () {",+ " pm.expect(jsonData.next_action.type).to.eql(\"three_ds_invoke\");",+ "});",+ "",+ "// Verify if 'three_ds_data' exists inside 'next_action'",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_data' under 'next_action'\", function () {",+ " pm.expect(jsonData.next_action).to.have.property(\"three_ds_data\");",+ "});",+ "",+ "// Verify if 'three_ds_authentication_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_authentication_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"three_ds_authentication_url\");",+ "});",+ "",+ "// Verify if 'three_ds_authorize_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_authorize_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"three_ds_authorize_url\");",+ "});",+ "",+ "// Verify if 'three_ds_method_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_method_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.three_ds_method_details).to.have.property(\"three_ds_method_url\");",+ "});",+ "",+ "// Verify if 'three_ds_method_data' exists and is not empty",+ "// Carries session-specific metadata for fingerprinting — must exist and be valid Base64.",+ "pm.test(\"[POST]::/payments - Should contain non-empty 'three_ds_method_data'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.three_ds_method_details).to.have.property(\"three_ds_method_data\").that.is.a('string').and.is.not.empty;",+ "});",+ "",+ "// Verify if 'poll_id' exists inside 'poll_config'",+ "// Polling is required to check 3DS status asynchronously while Netcetera finishes auth.",+ "pm.test(\"[POST]::/payments - Should contain 'poll_id' inside 'poll_config'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.poll_config).to.have.property(\"poll_id\");",+ "});",+ "",+ "// Verify if 'message_version' exists and is 2.1.0 or higher",+ "// Ensures compatibility with supported Netcetera protocol versions (2.1.0 and above).",+ "pm.test(\"[POST]::/payments - 'message_version' should exist and be >= 2.1.0\", function () {",+ " const version = jsonData.next_action.three_ds_data.message_version;",+ " pm.expect(version).to.match(/^2\\.(1|2|3)(\\.\\d+)?$/);",+ "});",+ "",+ "// Verify if 'directory_server_id' exists",+ "// Identifies the card network’s Directory Server (e.g., Visa = A000000003) for Netcetera routing.",+ "pm.test(\"[POST]::/payments - Should contain 'directory_server_id'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"directory_server_id\").that.is.a('string');",+ "});",+ "",+ "// Assert 'external_authentication_details' exists",+ "pm.test(\"[POST]::/payments - Should contain 'external_authentication_details'\", function () {",+ " pm.expect(jsonData).to.have.property(\"external_authentication_details\");",+ "});",+ "",+ "// Assert 'status' is 'pending' at the start of 3DS",+ "pm.test(\"[POST]::/payments - external_authentication_details.status should be 'pending'\", function () {",+ " pm.expect(jsonData.external_authentication_details.status).to.eql(\"pending\");",+ "});",+ "",+ "// Assert 'ds_transaction_id' exists (required for Netcetera 3DS tracking)",+ "pm.test(\"[POST]::/payments - Should contain 'ds_transaction_id'\", function () {",+ " pm.expect(jsonData.external_authentication_details.ds_transaction_id).to.be.a('string').and.is.not.empty;",+ "});",+ "",+ "// Assert 'version' is present and valid",+ "pm.test(\"[POST]::/payments - Should contain 3DS version\", function () {",+ " pm.expect(jsonData.external_authentication_details.version).to.match(/^2\\.(1|2|3)(\\.\\d+)?$/);",+ "});",+ ""+ ],+ "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\":\"automatic\",\"authentication_type\":\"three_ds\",\"request_external_three_ds_authentication\":true,\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"5367632000019972\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"123\"}},\"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 - Retrieve",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set 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_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ ""+ ],+ "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": "Scenario5-Create 3DS Challenge payment with Mastercard",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Verify if 'external_3ds_authentication_attempted' is true",+ "pm.test(\"[POST]::/payments - 'external_3ds_authentication_attempted' should be true\", function () {",+ " pm.expect(jsonData.external_3ds_authentication_attempted).to.be.true;",+ "});",+ "",+ "// Response body should have value \"requires_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content Verify if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ "",+ "// Verify if 'next_action' exists",+ "pm.test(\"[POST]::/payments - Should contain 'next_action'\", function () {",+ " pm.expect(jsonData).to.have.property(\"next_action\");",+ "});",+ "",+ "// Verify if 'next_action.type' is 'three_ds_invoke'",+ "pm.test(\"[POST]::/payments - 'next_action.type' should be 'three_ds_invoke'\", function () {",+ " pm.expect(jsonData.next_action.type).to.eql(\"three_ds_invoke\");",+ "});",+ "",+ "// Verify if 'three_ds_data' exists inside 'next_action'",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_data' under 'next_action'\", function () {",+ " pm.expect(jsonData.next_action).to.have.property(\"three_ds_data\");",+ "});",+ "",+ "// Verify if 'three_ds_authentication_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_authentication_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"three_ds_authentication_url\");",+ "});",+ "",+ "// Verify if 'three_ds_authorize_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_authorize_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"three_ds_authorize_url\");",+ "});",+ "",+ "// Verify if 'three_ds_method_url' exists",+ "pm.test(\"[POST]::/payments - Should contain 'three_ds_method_url'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.three_ds_method_details).to.have.property(\"three_ds_method_url\");",+ "});",+ "",+ "// Verify if 'three_ds_method_data' exists and is not empty",+ "// Carries session-specific metadata for fingerprinting — must exist and be valid Base64.",+ "pm.test(\"[POST]::/payments - Should contain non-empty 'three_ds_method_data'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.three_ds_method_details).to.have.property(\"three_ds_method_data\").that.is.a('string').and.is.not.empty;",+ "});",+ "",+ "// Verify if 'poll_id' exists inside 'poll_config'",+ "// Polling is required to check 3DS status asynchronously while Netcetera finishes auth.",+ "pm.test(\"[POST]::/payments - Should contain 'poll_id' inside 'poll_config'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data.poll_config).to.have.property(\"poll_id\");",+ "});",+ "",+ "// Verify if 'message_version' exists and is 2.1.0 or higher",+ "// Ensures compatibility with supported Netcetera protocol versions (2.1.0 and above).",+ "pm.test(\"[POST]::/payments - 'message_version' should exist and be >= 2.1.0\", function () {",+ " const version = jsonData.next_action.three_ds_data.message_version;",+ " pm.expect(version).to.match(/^2\\.(1|2|3)(\\.\\d+)?$/);",+ "});",+ "",+ "// Verify if 'directory_server_id' exists",+ "// Identifies the card network’s Directory Server (e.g., Visa = A000000003) for Netcetera routing.",+ "pm.test(\"[POST]::/payments - Should contain 'directory_server_id'\", function () {",+ " pm.expect(jsonData.next_action.three_ds_data).to.have.property(\"directory_server_id\").that.is.a('string');",+ "});",+ "",+ "// Assert 'external_authentication_details' exists",+ "pm.test(\"[POST]::/payments - Should contain 'external_authentication_details'\", function () {",+ " pm.expect(jsonData).to.have.property(\"external_authentication_details\");",+ "});",+ "",+ "// Assert 'status' is 'pending' at the start of 3DS",+ "pm.test(\"[POST]::/payments - external_authentication_details.status should be 'pending'\", function () {",+ " pm.expect(jsonData.external_authentication_details.status).to.eql(\"pending\");",+ "});",+ "",+ "// Assert 'ds_transaction_id' exists (required for Netcetera 3DS tracking)",+ "pm.test(\"[POST]::/payments - Should contain 'ds_transaction_id'\", function () {",+ " pm.expect(jsonData.external_authentication_details.ds_transaction_id).to.be.a('string').and.is.not.empty;",+ "});",+ "",+ "// Assert 'version' is present and valid",+ "pm.test(\"[POST]::/payments - Should contain 3DS version\", function () {",+ " pm.expect(jsonData.external_authentication_details.version).to.match(/^2\\.(1|2|3)(\\.\\d+)?$/);",+ "});",+ ""+ ],+ "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\":\"automatic\",\"authentication_type\":\"three_ds\",\"request_external_three_ds_authentication\":true,\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"5267648608924299\",\"card_exp_month\":\"01\",\"card_exp_year\":\"50\",\"card_holder_name\":\"John Doe\",\"card_cvc\":\"123\"}},\"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 - Retrieve",+ "event": [{- "name": "Refunds - 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 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.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"requires_customer_action\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_customer_action'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " },",+ " );",+ "}",+ ""+ ],+ "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": [{- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/refunds - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",- " console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",- " );",- "}",- "",- "// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have value \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }+ "key": "force_sync",+ "value": "true"}],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/refunds",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds"- ]- },- "description": "To create a refund against an already processed payment"- },- "response": []- }- ]+ "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": []}]}@@ -11174,6 +15536,31 @@{"key": "archipel_transaction_uuid","value": ""+ },+ {+ "key": "netcetera_certificate",+ "value": "",+ "type": "string"+ },+ {+ "key": "netcetera_private_key",+ "value": "",+ "type": "string"+ },+ {+ "key": "netcetera_merchant_configuration_id",+ "value": "",+ "type": "string"+ },+ {+ "key": "netcetera_requestor_url",+ "value": "",+ "type": "string"+ },+ {+ "key": "netcetera_requestor_app_url",+ "value": "",+ "type": "string"}]}