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-actionscb5761be47fa
diff --git a/postman/collection-json/adyen_uk.postman_collection.json b/postman/collection-json/adyen_uk.postman_collection.jsonindex 14a9a13f05..08cf0761e4 100644--- a/postman/collection-json/adyen_uk.postman_collection.json+++ b/postman/collection-json/adyen_uk.postman_collection.json@@ -472,7 +472,7 @@"language": "json"}},- "raw": "{\"connector_type\":\"fiz_operations\",\"connector_name\":\"adyen\",\"connector_account_details\":{\"auth_type\":\"BodyKey\",\"api_key\":\"{{connector_api_key}}\",\"key1\":\"{{connector_key1}}\",\"api_secret\":\"{{connector_api_secret}}\"},\"test_mode\":false,\"disabled\":false,\"business_country\":\"US\",\"business_label\":\"default\",\"payment_methods_enabled\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"debit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"payment_method_type\":\"klarna\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"affirm\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"afterpay_clearpay\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"pay_bright\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"walley\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"paypal\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"google_pay\",\"payment_experience\":\"invoke_sdk_client\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"apple_pay\",\"payment_experience\":\"invoke_sdk_client\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"mobile_pay\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"ali_pay\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"we_chat_pay\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"mb_way\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"gift_card\",\"payment_method_types\":[{\"payment_method_type\":\"givex\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_redirect\",\"payment_method_types\":[{\"payment_method_type\":\"giropay\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"eps\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sofort\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"blik\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"trustly\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_czech_republic\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_finland\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_poland\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_slovakia\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bancontact_card\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_debit\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bacs\",\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"metadata\":{\"google_pay\":{\"allowed_payment_methods\":[{\"type\":\"CARD\",\"parameters\":{\"allowed_auth_methods\":[\"PAN_ONLY\",\"CRYPTOGRAM_3DS\"],\"allowed_card_networks\":[\"AMEX\",\"DISCOVER\",\"INTERAC\",\"JCB\",\"MASTERCARD\",\"VISA\"]},\"tokenization_specification\":{\"type\":\"PAYMENT_GATEWAY\"}}],\"merchant_info\":{\"merchant_name\":\"Narayan Bhat\"}}}}"+ "raw": "{\"connector_type\":\"fiz_operations\",\"connector_name\":\"adyen\",\"connector_account_details\":{\"auth_type\":\"BodyKey\",\"api_key\":\"{{connector_api_key}}\",\"key1\":\"{{connector_key1}}\",\"api_secret\":\"{{connector_api_secret}}\"},\"test_mode\":true,\"disabled\":false,\"business_country\":\"US\",\"business_label\":\"default\",\"payment_methods_enabled\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"debit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"payment_method_type\":\"klarna\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"affirm\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"afterpay_clearpay\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"pay_bright\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"walley\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"paypal\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"google_pay\",\"payment_experience\":\"invoke_sdk_client\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"apple_pay\",\"payment_experience\":\"invoke_sdk_client\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"mobile_pay\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"ali_pay\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"we_chat_pay\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"mb_way\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"gift_card\",\"payment_method_types\":[{\"payment_method_type\":\"givex\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_redirect\",\"payment_method_types\":[{\"payment_method_type\":\"giropay\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"eps\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sofort\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"blik\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"trustly\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_czech_republic\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_finland\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_poland\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_slovakia\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bancontact_card\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_debit\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bacs\",\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"metadata\":{\"google_pay\":{\"allowed_payment_methods\":[{\"type\":\"CARD\",\"parameters\":{\"allowed_auth_methods\":[\"PAN_ONLY\",\"CRYPTOGRAM_3DS\"],\"allowed_card_networks\":[\"AMEX\",\"DISCOVER\",\"INTERAC\",\"JCB\",\"MASTERCARD\",\"VISA\"]},\"tokenization_specification\":{\"type\":\"PAYMENT_GATEWAY\"}}],\"merchant_info\":{\"merchant_name\":\"Narayan Bhat\"}}}}"},"url": {"raw": "{{baseUrl}}/account/:account_id/connectors",@@ -3020,7 +3020,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) {",@@ -3051,9 +3051,9 @@"// 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'\",",+ " \"[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'processing'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"cancelled\");",+ " pm.expect(jsonData.status).to.eql(\"processing\");"," },"," );","}",@@ -3134,7 +3134,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) {",@@ -3178,9 +3178,9 @@"// Response body should have value \"cancelled\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'processing'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"cancelled\");",+ " pm.expect(jsonData.status).to.eql(\"processing\");"," },"," );","}",diff --git a/postman/collection-json/stripe.postman_collection.json b/postman/collection-json/stripe.postman_collection.jsonindex 7df7ba5158..78a1777864 100644--- a/postman/collection-json/stripe.postman_collection.json+++ b/postman/collection-json/stripe.postman_collection.json@@ -6312,10 +6312,10 @@"name": "Happy Cases","item": [{- "name": "Scenario28-Confirm a payment with requires_customer_action status",+ "name": "Scenario2-Create a payment and Confirm","item": [{- "name": "Payments - Create with confirm true",+ "name": "Payments - Create","event": [{"listen": "test",@@ -6383,104 +6383,24 @@" );","}","",- "// Response body should have value \"requires_customer_action\" 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_customer_action'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");"," },"," );","}",- "",- "// Response body should have \"next_action.redirect_to_url\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'next_action.redirect_to_url' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"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\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"business_country\":\"US\",\"business_label\":\"default\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://duck.com\",\"setup_future_usage\":\"on_session\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"routing\":{\"type\":\"single\",\"data\":\"stripe\"}}"- },- "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",+ "listen": "prerequest","script": {"exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 400\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// 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 appropriatae error message",- "if (jsonData?.message) {",- " pm.test(",- " \"Content check if appropriate error message is present\",",- " function () {",- " pm.expect(jsonData.message).to.eql(\"You cannot confirm this payment because it has status requires_customer_action\");",- " },",- " );",- "}",""],"type": "text/javascript"@@ -6488,26 +6408,6 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -6526,56 +6426,45 @@"language": "json"}},- "raw": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"Joseph Doe\",\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"},"response": []- }- ]- },- {- "name": "Scenario1-Create payment with confirm true",- "item": [+ },{- "name": "Payments - Create",+ "name": "Payments - Confirm","event": [{"listen": "test","script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {"," pm.response.to.be.success;","});","","// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -6627,21 +6516,21 @@"// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",- "",- "// Response body should have \"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"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [""],"type": "text/javascript"@@ -6649,6 +6538,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": [{@@ -6667,18 +6576,27 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"bernard123\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"setup_future_usage\":\"on_session\",\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"01\",\"card_exp_year\":\"26\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"routing\":{\"type\":\"single\",\"data\":\"stripe\"}}"+ "raw": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"Joseph Doe\",\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"},"url": {- "raw": "{{baseUrl}}/payments",+ "raw": "{{baseUrl}}/payments/:id/confirm","host": ["{{baseUrl}}"],"path": [- "payments"+ "payments",+ ":id",+ "confirm"+ ],+ "variable": [+ {+ "key": "id",+ "value": "{{payment_id}}",+ "description": "(Required) unique payment id"+ }]},- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"},"response": []},@@ -6751,24 +6669,15 @@" );","}","",- "// Response body should have value \"Succeeded\" for \"status\"",+ "// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",- "",- "// Response body should have \"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"@@ -6813,10 +6722,10 @@]},{- "name": "Scenario2-Create payment with confirm false",+ "name": "Scenario28-Confirm a payment with requires_customer_action status","item": [{- "name": "Payments - Create",+ "name": "Payments - Create with confirm true","event": [{"listen": "test",@@ -6884,24 +6793,24 @@" );","}","",- "// Response body should have value \"requires_payment_method\" for \"status\"",+ "// Response body should have value \"requires_customer_action\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'\","," function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");"," },"," );","}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [+ "",+ "// Response body should have \"next_action.redirect_to_url\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'next_action.redirect_to_url' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"undefined\").to.be",+ " .true;",+ " },",+ ");",""],"type": "text/javascript"@@ -6927,7 +6836,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"business_country\":\"US\",\"business_label\":\"default\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://duck.com\",\"setup_future_usage\":\"on_session\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"routing\":{\"type\":\"single\",\"data\":\"stripe\"}}"},"url": {"raw": "{{baseUrl}}/payments",@@ -6950,22 +6859,1030 @@"script": {"exec": ["// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",+ "pm.test(\"[GET]::/payments/:id - Status code is 400\", function () {",+ " pm.response.to.be.error;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// 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 appropriatae error message",+ "if (jsonData?.message) {",+ " pm.test(",+ " \"Content check if appropriate error message is present\",",+ " function () {",+ " pm.expect(jsonData.message).to.eql(\"You cannot confirm this payment because it has status requires_customer_action\");",+ " },",+ " );",+ "}",+ ""+ ],+ "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": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"Joseph Doe\",\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"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": "Scenario29-Create payment with payment method billing",+ "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\"",+ "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;",+ " },",+ ");",+ "",+ "// Response body should have \"payment_method_data.billing\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'payment_method_data.billing' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.payment_method_data.billing !== \"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\":6540,\"currency\":\"USD\",\"confirm\":true,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"bernard123\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"setup_future_usage\":\"on_session\",\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"01\",\"card_exp_year\":\"26\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrisoff Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Narayan\",\"last_name\":\"Doe\"},\"email\":\"[email protected]\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"routing\":{\"type\":\"single\",\"data\":\"stripe\"}}"+ },+ "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 mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"Succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have \"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 \"payment_method_data.billing\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'payment_method_data.billing' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.payment_method_data.billing !== \"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": "Scenario30-Update payment with payment method billing",+ "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\":6540,\"currency\":\"USD\",\"confirm\":false,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"bernard123\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"setup_future_usage\":\"on_session\",\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"routing\":{\"type\":\"single\",\"data\":\"stripe\"}}"+ },+ "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 - Update",+ "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) { }",+ "",+ "// 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_confirmation\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have \"payment_method_data.billing\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'payment_method_data.billing' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.payment_method_data.billing !== \"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": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"01\",\"card_exp_year\":\"26\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrisoff Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Narayan\",\"last_name\":\"Doe\"},\"email\":\"[email protected]\"}}}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments/:id",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments",+ ":id"+ ],+ "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) { }",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"requires_confirmation\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",+ " },",+ " );",+ "}",+ "",+ "// Response body should have \"payment_method_data.billing\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'payment_method_data.billing' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.payment_method_data.billing !== \"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": "Scenario31-Pass payment method billing in Confirm",+ "item": [+ {+ "name": "Payments - Create",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"requires_payment_method\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments",+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "payments"+ ]+ },+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"+ },+ "response": []+ },+ {+ "name": "Payments - Confirm",+ "event": [+ {+ "listen": "test",+ "script": {+ "exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(",+ " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",+ " function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ " },",+ ");",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"succeeded\" for \"status\"",+ "if (jsonData?.status) {",+ " pm.test(",+ " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " function () {",+ " pm.expect(jsonData.status).to.eql(\"succeeded\");",+ " },",+ " );",+ "}",+ ""+ ],+ "type": "text/javascript"+ }+ },+ {+ "listen": "prerequest",+ "script": {+ "exec": [+ ""+ ],+ "type": "text/javascript"+ }+ }+ ],+ "request": {+ "auth": {+ "type": "apikey",+ "apikey": [+ {+ "key": "value",+ "value": "{{publishable_key}}",+ "type": "string"+ },+ {+ "key": "key",+ "value": "api-key",+ "type": "string"+ },+ {+ "key": "in",+ "value": "header",+ "type": "string"+ }+ ]+ },+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"Joseph Doe\",\"card_cvc\":\"123\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrisoff Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Narayan\",\"last_name\":\"Doe\"},\"email\":\"[email protected]\"}},\"client_secret\":\"{{client_secret}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ },+ "url": {+ "raw": "{{baseUrl}}/payments/:id/confirm",+ "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(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",+ "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});","","// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",+ "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {"," pm.response.to.have.jsonBody();","});","",@@ -6973,7 +7890,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) {",@@ -7017,21 +7934,154 @@"// Response body should have value \"succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",+ "",+ "// Response body should have \"payment_method_data.billing\"",+ "pm.test(",+ " \"[POST]::/payments - Content check if 'payment_method_data.billing' exists\",",+ " function () {",+ " pm.expect(typeof jsonData.payment_method_data.billing !== \"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": "prerequest",+ "listen": "test","script": {"exec": [+ "// Validate status 2xx",+ "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",+ " pm.response.to.be.success;",+ "});",+ "",+ "// Validate if response header has matching content-type",+ "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",+ " \"application/json\",",+ " );",+ "});",+ "",+ "// Validate if response has JSON Body",+ "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",+ " pm.response.to.have.jsonBody();",+ "});",+ "",+ "// Set response object as internal variable",+ "let jsonData = {};",+ "try {",+ " jsonData = pm.response.json();",+ "} catch (e) {}",+ "",+ "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",+ "if (jsonData?.payment_id) {",+ " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",+ " console.log(",+ " \"- use {{payment_id}} as collection variable for value\",",+ " jsonData.payment_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",+ "if (jsonData?.mandate_id) {",+ " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",+ " console.log(",+ " \"- use {{mandate_id}} as collection variable for value\",",+ " jsonData.mandate_id,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",+ " );",+ "}",+ "",+ "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",+ "if (jsonData?.client_secret) {",+ " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",+ " console.log(",+ " \"- use {{client_secret}} as collection variable for value\",",+ " jsonData.client_secret,",+ " );",+ "} else {",+ " console.log(",+ " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",+ " );",+ "}",+ "",+ "// Response body should have value \"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;",+ " },",+ ");",""],"type": "text/javascript"@@ -7039,26 +8089,6 @@}],"request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },"method": "POST","header": [{@@ -7077,27 +8107,18 @@"language": "json"}},- "raw": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"Joseph Doe\",\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"125.0.0.1\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"bernard123\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"setup_future_usage\":\"on_session\",\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"01\",\"card_exp_year\":\"26\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"routing\":{\"type\":\"single\",\"data\":\"stripe\"}}"},"url": {- "raw": "{{baseUrl}}/payments/:id/confirm",+ "raw": "{{baseUrl}}/payments","host": ["{{baseUrl}}"],"path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }+ "payments"]},- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"+ "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"},"response": []},@@ -7170,15 +8191,24 @@" );","}","",- "// Response body should have value \"succeeded\" for \"status\"",+ "// Response body should have value \"Succeeded\" for \"status\"","if (jsonData?.status) {"," pm.test(",- " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\",",+ " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\","," function () {"," pm.expect(jsonData.status).to.eql(\"succeeded\");"," },"," );","}",+ "",+ "// Response body should have \"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"